matlab for 循环那个end出错的问题自己解决了.现在多了其他问题.我是这样写的.for i=1:9x(i)=cos(j(i)/180)y(i)=sin(j(i)/180)[o,p,q,dx,dy,dz,ex,ey,ez]=fsolve('[0:x(i)-o;0:y(i)-p;0:0-q]*[0;dx;0;dy;0:dz]=norm([0:x(i)-o;0:y(i)-p;0:0
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/22 20:26:23
matlab for 循环那个end出错的问题自己解决了.现在多了其他问题.我是这样写的.for i=1:9x(i)=cos(j(i)/180)y(i)=sin(j(i)/180)[o,p,q,dx,dy,dz,ex,ey,ez]=fsolve('[0:x(i)-o;0:y(i)-p;0:0-q]*[0;dx;0;dy;0:dz]=norm([0:x(i)-o;0:y(i)-p;0:0
matlab for 循环
那个end出错的问题自己解决了.现在多了其他问题.我是这样写的.
for i=1:9
x(i)=cos(j(i)/180)
y(i)=sin(j(i)/180)
[o,p,q,dx,dy,dz,ex,ey,ez]=fsolve('[0:x(i)-o;0:y(i)-p;0:0-q]*[0;dx;0;dy;0:dz]=norm([0:x(i)-o;0:y(i)-p;0:0-q])*cos(d(i))','[0:x(i)-o;0:y(i)-p;0:0-q]*[0;ex;0;ey;0:ez]=norm([0:x(i)-o;0:y(i)-p;0:0-q])*cos(c(i))','[0;dx;0;dy;0:dz]*[0;ex;0;ey;0:ez]=0')
end
提示
Error using fsolve
Too many output arguments.
请问怎么修改,让其解出[o,p,q,dx,dy,dz,ex,ey,ez]这9个值?
matlab for 循环那个end出错的问题自己解决了.现在多了其他问题.我是这样写的.for i=1:9x(i)=cos(j(i)/180)y(i)=sin(j(i)/180)[o,p,q,dx,dy,dz,ex,ey,ez]=fsolve('[0:x(i)-o;0:y(i)-p;0:0-q]*[0;dx;0;dy;0:dz]=norm([0:x(i)-o;0:y(i)-p;0:0
for i=1:9
x(i)=cos(i)/180
y(i)=sin(i)/180
[o,p,q,dx,dy,dz,ex,ey,ez]=fsolve('[0:x(i)-o;0:y(i)-p;0:0-q]*[0;dx;0;dy;0:dz]=norm([0:x(i)-o;0:y(i)-p;0:0-q])*cos(d(i))','[0:x(i)-o;0:y(i)-p;0:0-q]*[0;ex;0;ey;0:ez]=norm([0:x(i)-o;0:y(i)-p;0:0-q])*cos(c(i))','[0;dx;0;dy;0:dz]*[0;ex;0;ey;0:ez]=0')
end
你好,你可以将你要求解的函数写成A*x = b 的形式 然后利用x = A\b或者x = inv(A)*b