作业帮 > 综合 > 作业

matlab编程显示曲线 .帮助修正程序中的错误,能运行出曲线来就感激不尽了~

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/10/04 03:18:22
matlab编程显示曲线 .帮助修正程序中的错误,能运行出曲线来就感激不尽了~
l1=2000/3;
l2=1000;
r1=40;
r2=20;
r3=60;
x=0:pi/180:pi/2;
y= r1.*(pi/2-x+asin((r1-r2)/l1))
+r3.*(pi/2-acos((l2.^2-l1.*l2.*cos(x))/(l2.*sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))+asin((r3-r2)/sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))
+r2.*(x+acos((l2.^2-l1.*l2.*cos(x))/(l2.*sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))-asin((r1-r2)/l1)-asin((r3-r2)/sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))
+sqrt(l1.^2-r1.^2-r2.^2+2.*r1.*r2)
+sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x)-r3.^2-r2.^2+2.*r3.*r2);
plot(x,y,'r-'),grid on;
(r3 -r2)后面应该加点号(.)
= r1.*(pi/2-x+asin((r1-r2)/l1))
+r3.*(pi/2-acos((l2.^2-l1.*l2.*cos(x))/(l2.*sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))+asin((r3-r2)./sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))
+r2.*(x+acos((l2.^2-l1.*l2.*cos(x))/(l2.*sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))-asin((r1-r2)/l1)-asin((r3-r2)./sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))
+sqrt(l1.^2-r1.^2-r2.^2+2.*r1.*r2)
+sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x)-r3.^2-r2.^2+2.*r3.*r2);
还要注意你写公式对不对,这个跟程序没有关系,自己检测,