matlab求方程组问题L1=304.8;L2=101.6;L3=254.0;L4=177.8;th2=[0:1/36:

matlab求方程组问题
L1=304.8;L2=101.6;L3=254.0;L4=177.8;
th2=[0:1/36:2]*pi;
options=optimset('display','off');
for m=1:length(th2)
th34(m,:)=fsolve('fourbarposition',[1 1],options,th2(m),L2,L3,L4,L1);
end
w2=250;
for i=1:length(th2)
A=[-L3*sin(th34(i,1)) L4*sin(th34(i,2)); L3*cos(th34(i:1)) -L4*cos(th34(i,2))];
B=[w2*L2*sin(th2(i)); -w2*L2*cos(th2(i))];
w=inv(A)*B;
w3(i)=w(1);
w4(i)=w(2);
end
plot(th2*180/pi,w3,th2*180/pi,w4);
就刚才哪错误,感激不尽!
Error using ==> vertcat
All rows in the bracketed expression must have the same
number of columns.
Error in ==> D:MATLAB6p5shiyan.m
On line 9 ==> A=[-L3*sin(th34(i,1)) L4*sin(th34(i,2)); L3*cos(th34(i:1)) -L4*cos(th34(i,2))];
小熊猫团团 1年前 已收到1个回答 举报

秋千上的天使 幼苗

共回答了20个问题采纳率:90% 举报

将“:”改为“,”
A=[-L3*sin(th34(i,1)) L4*sin(th34(i,2)); L3*cos(th34(i,1)) -L4*cos(th34(i,2))];

1年前

8
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.039 s. - webmaster@yulucn.com