matlab求含有参数的三元一次方程?
symstheta_stheta_pabF1F2t11t12t13t21t22t23t31t32t33s0t0;%%x1=s0*cos(theta_s)+b*t12;y1...
syms theta_s theta_p a b F1 F2 t11 t12 t13 t21 t22 t23 t31 t32 t33 s0 t0;
%%
x1=s0*cos(theta_s)+b*t12;
y1=s0*cos(theta_s)+(sqrt(3)*a-sqrt(3)*b*t11-b*t12)/2;
z1=s0*cos(theta_s)+(sqrt(3)*b*t11-sqrt(3)*a-b*t12)/2;
w1=F1*cos(theta_s);
%%
x2=s0*sin(theta_s)-a+b*t22;
y2=s0*sin(theta_s)+(a-sqrt(3)*b*t21-b*t22)/2;
z2=s0*sin(theta_s)+(a+sqrt(3)*b*t21-b*t22)/2;
w2=F1*sin(theta_s);
%%
x3=t0+b*t32;
y3=t0-(sqrt(3)*b*t31+b*t32)/2;
z3=t0+(sqrt(3)*b*t31-b*t32)/2;
w3=-F2;
%%
[t1,t2,t3]=solve('x1*t1+y1*t2+z1*t3+w1=0','x2*t1+y2*t2+z2*t3+w2=0','x3*t1+y3*t2+z3*t3+w3=0','t1','t2','t3')
??? Attempt to execute SCRIPT solve as a function:D:\Users\Kuki(U)\Desktop\solve.m
Error in ==> solve at 18[t1,t2,t3]=solve('x1*t1+y1*t2+z1*t3+w1=0','x2*t1+y2*t2+z2*t3+w2=0','x3*t1+y3*t2+z3*t3+w3=0','t1','t2','t3')
什么原因啊,求指点? 展开
%%
x1=s0*cos(theta_s)+b*t12;
y1=s0*cos(theta_s)+(sqrt(3)*a-sqrt(3)*b*t11-b*t12)/2;
z1=s0*cos(theta_s)+(sqrt(3)*b*t11-sqrt(3)*a-b*t12)/2;
w1=F1*cos(theta_s);
%%
x2=s0*sin(theta_s)-a+b*t22;
y2=s0*sin(theta_s)+(a-sqrt(3)*b*t21-b*t22)/2;
z2=s0*sin(theta_s)+(a+sqrt(3)*b*t21-b*t22)/2;
w2=F1*sin(theta_s);
%%
x3=t0+b*t32;
y3=t0-(sqrt(3)*b*t31+b*t32)/2;
z3=t0+(sqrt(3)*b*t31-b*t32)/2;
w3=-F2;
%%
[t1,t2,t3]=solve('x1*t1+y1*t2+z1*t3+w1=0','x2*t1+y2*t2+z2*t3+w2=0','x3*t1+y3*t2+z3*t3+w3=0','t1','t2','t3')
??? Attempt to execute SCRIPT solve as a function:D:\Users\Kuki(U)\Desktop\solve.m
Error in ==> solve at 18[t1,t2,t3]=solve('x1*t1+y1*t2+z1*t3+w1=0','x2*t1+y2*t2+z2*t3+w2=0','x3*t1+y3*t2+z3*t3+w3=0','t1','t2','t3')
什么原因啊,求指点? 展开
1个回答
展开全部
我觉着很可能是你的matlab版本有点低,或者路径设置有问题,他找不到solve函数,我这里复制粘贴过来,就可以执行,并得到了结果,你看看:
t1 =
-(w1*y2*z3 - w1*y3*z2 - w2*y1*z3 + w2*y3*z1 + w3*y1*z2 - w3*y2*z1)/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1)
t2 =
(w1*x2*z3 - w1*x3*z2 - w2*x1*z3 + w2*x3*z1 + w3*x1*z2 - w3*x2*z1)/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1)
t3 =
-(w1*x2*y3 - w1*x3*y2 - w2*x1*y3 + w2*x3*y1 + w3*x1*y2 - w3*x2*y1)/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1)
t1 =
-(w1*y2*z3 - w1*y3*z2 - w2*y1*z3 + w2*y3*z1 + w3*y1*z2 - w3*y2*z1)/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1)
t2 =
(w1*x2*z3 - w1*x3*z2 - w2*x1*z3 + w2*x3*z1 + w3*x1*z2 - w3*x2*z1)/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1)
t3 =
-(w1*x2*y3 - w1*x3*y2 - w2*x1*y3 + w2*x3*y1 + w3*x1*y2 - w3*x2*y1)/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询