问题描述:
matlab 中定义多个变量,然后对含有多个变量的表达式求导的问题
>> syms x l
>> syms t
>> n1 = (x/t-1)*(x/t-1/2)
n1 =
(x/t - 1)*(x/t - 1/2)
>> diff(n1)
ans =
(x/t - 1)/t + (x/t - 1/2)/t
>> diff(n1,x)
ans =
(x/t - 1)/t + (x/t - 1/2)/t
>> diff(n1,t)
ans =
- (x*(x/t - 1))/t^2 - (x*(x/t - 1/2))/t^2
>> int(diff(n1,t))
ans =
(x^2*(9*t - 8*x))/(12*t^3)
直接diff(n1)默认是对哪个变量求的导?怎么确定是对哪个变量求导?还是把n1求导再积分后为什么不是一个式子了?
>> syms x l
>> syms t
>> n1 = (x/t-1)*(x/t-1/2)
n1 =
(x/t - 1)*(x/t - 1/2)
>> diff(n1)
ans =
(x/t - 1)/t + (x/t - 1/2)/t
>> diff(n1,x)
ans =
(x/t - 1)/t + (x/t - 1/2)/t
>> diff(n1,t)
ans =
- (x*(x/t - 1))/t^2 - (x*(x/t - 1/2))/t^2
>> int(diff(n1,t))
ans =
(x^2*(9*t - 8*x))/(12*t^3)
直接diff(n1)默认是对哪个变量求的导?怎么确定是对哪个变量求导?还是把n1求导再积分后为什么不是一个式子了?
问题解答:
我来补答展开全文阅读