早教吧 育儿知识 作业答案 考试题库 百科 知识分享

matlab求方程组问题L1=304.8;L2=101.6;L3=254.0;L4=177.8;th2=[0:1/36:2]*pi;options=optimset('display','off');form=1:length(th2)th34(m,:)=fsolve('fourbarposition',[11],options,th2(m),L2,L3,L4,L1);endw2=250;fori=1:length(th2)A=[-L3*sin(th34(i,1)

题目详情
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:\MATLAB6p5\shiyan.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))];
▼优质解答
答案和解析
将“:”改为“,”
A=[-L3*sin(th34(i,1)) L4*sin(th34(i,2)); L3*cos(th34(i,1)) -L4*cos(th34(i,2))];
看了 matlab求方程组问题L1...的网友还看了以下: