matlab中怎么用编号来进行一个数组(?)的赋值
symsx1x2x3x4x5x6x7ydy1dy2dy3dy4dy5dy6dy7;y=174.42*(x1/x5)*(x3/(x2-x1))^0.85*sqrt((1-2...
syms x1 x2 x3 x4 x5 x6 x7 y dy1 dy2 dy3 dy4 dy5 dy6 dy7;
y=174.42*(x1/x5)*(x3/(x2-x1))^0.85*sqrt((1-2.62*(1-0.36*(x4/x3)^(-0.56))^(3/2)*(x4/x2)^1.16)/(x6*x7));
for i=1:7
dy(i)=inline(char(diff(y,x(i))))
end
像这样用for简化求7个未知数各自对应的偏导数的程序应该怎么写啊
主要问题就在for循环里用i编号那里,该怎么写才能成功运行??? 展开
y=174.42*(x1/x5)*(x3/(x2-x1))^0.85*sqrt((1-2.62*(1-0.36*(x4/x3)^(-0.56))^(3/2)*(x4/x2)^1.16)/(x6*x7));
for i=1:7
dy(i)=inline(char(diff(y,x(i))))
end
像这样用for简化求7个未知数各自对应的偏导数的程序应该怎么写啊
主要问题就在for循环里用i编号那里,该怎么写才能成功运行??? 展开
1个回答
展开全部
syms x1 x2 x3 x4 x5 x6 x7 dy1 dy2 dy3 dy4 dy5 dy6 dy7;
x = sym([x1,x2,x3,x4,x5,x6,x7]);
dy = sym([dy1,dy2,dy3,dy4,dy5,dy6,dy7]);
y = 174.42*(x1/x5)*(x3/(x2-x1))^0.85* ...
sqrt((1-2.62*(1-0.36*(x4/x3)^(-0.56))^(3/2)*(x4/x2)^1.16) ...
/(x6*x7));
for i = 1:7
dy(i) = inline(char(diff(y,x(i))));
end
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询