matlab用plot语句出错显示? Error using ==> plot Conversion to double from sym is not possible.clear;clc;r=10;%%滚子半径r0=50;%%基圆半径e=20;%%偏心距delt0=120*pi/180;%%升程角,回程角,休止角h=50;%%升程距离i=100;%%角度步

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 15:29:12
matlab用plot语句出错显示? Error using ==> plot Conversion to double from sym is not possible.clear;clc;r=10;%%滚子半径r0=50;%%基圆半径e=20;%%偏心距delt0=120*pi/180;%%升程角,回程角,休止角h=50;%%升程距离i=100;%%角度步
xVRF~ 3e#[6""SxBggږݫf@tB$d:˜,sWjh3}{o|9ux匏z2|6ں~||fۖ,aYe g|sjuVq,F`piQ$DAȞU Eavrrt6ܵU-/rPѺ{@ȵL^)~7~#>ja@s{}j>FXwz;Sl?Y=-XjbF%>wN pi;J?<_ޜrW_$<Ѹ?J,@vX[Xy}dg0*/_)DX˱,eyl8\) SEb1P pqYpy*!a(+fG3pft@bi)tK(bK8臰r"K oq(c< 'iE8JVHK I6vvCBZaP9 .пq'a.9js|!Gt:բu756Cˤ\/&يHe# Bjc56 ӟ4gjIǝ,0 9y=Z8b dթ7z=>~FutDÝn<& ,-11$ /X&kJt(Gy;GFv}~ h dׅȬ썃 dǿ'w6:*jB̒,VDRxqm6LBld8_T[s"ĀijlF[GwLv۷ڣ!^}?

matlab用plot语句出错显示? Error using ==> plot Conversion to double from sym is not possible.clear;clc;r=10;%%滚子半径r0=50;%%基圆半径e=20;%%偏心距delt0=120*pi/180;%%升程角,回程角,休止角h=50;%%升程距离i=100;%%角度步
matlab用plot语句出错显示? Error using ==> plot Conversion to double from sym is not possible.
clear;
clc;
r=10;%%滚子半径
r0=50;%%基圆半径
e=20;%%偏心距
delt0=120*pi/180;%%升程角,回程角,休止角
h=50;%%升程距离
i=100;%%角度步数
%%凸轮位移,速度,加速度计算
s0=sqrt(r0^2-e^2);
syms delt1 delt2 delt3;
s1=h*((delt1/delt0)-sin(2*pi*delt1/delt0)/(2*pi));
v1=diff(s1);
a1=diff(s1,2);
s2=h*((delt1/delt0)-sin(2*pi*delt1/delt0)/(2*pi)-(delt2/delt0));
v2=diff(s2);
a2=diff(s2,2);
delt1=linspace(0,delt0,i);
delt2=linspace(delt0,240*pi/180,i);
delt3=linspace(240*pi/180,2*pi,i);
s3=0*delt3;
delt=[delt1 delt2 delt3];
s11=subs(s1,delt1);
v11=subs(v1,delt1);
a11=subs(a1,delt1);
s22=subs(s2,delt2);
v22=subs(v2,delt2);
a22=subs(a2,delt2);
s=[s11 s22 s3];
v=[v11 v22 s3];
a=[a11 a22 s3];
%凸轮位移,速度,加速度曲线
plot(delt*180/pi,s,delt*180/pi,v,'-.',delt*180/pi,a,'--');
title('凸轮位移,速度,加速度曲线');
legend('位移曲线','速度曲线','加速度曲线');
axis([0 360 -80 80]);
grid on
%凸轮理论轮廓曲线计算
for j=1:3*i
xx(j)=(s0+s(j))*sin(delt(j))-e*cos(delt(j));
yy(j)=(s0+s(j))*cos(delt(j))+e*cos(delt(j));
end
%%凸轮实际工作轮廓曲线计算
for m=1:3*i
syms deltxy
x=(s0+s(m))*sin(deltxy)+e*cos(deltxy);
y=(s0+s(m))*cos(deltxy)-e*sin(deltxy);
sx=diff(x,deltxy)/(sqrt((diff(x,deltxy))^2+(diff(y,deltxy))^2));
cx=-diff(y,deltxy)/(sqrt((diff(x,deltxy))^2+(diff(y,deltxy))^2));
deltxy=delt(m);
ax(m)=subs(sx,deltxy);
bx(m)=subs(cx,deltxy);
xxx(m)=xx(m)-r*bx(m);
yyy(m)=yy(m)-r*ax(m);
end
figure
plot(xxx,yyy)
grid on
title('凸轮实践轮廓曲线');
cave=[xxx;yyy;o*xxx-5];
fprintf('%10.6f',cave)

matlab用plot语句出错显示? Error using ==> plot Conversion to double from sym is not possible.clear;clc;r=10;%%滚子半径r0=50;%%基圆半径e=20;%%偏心距delt0=120*pi/180;%%升程角,回程角,休止角h=50;%%升程距离i=100;%%角度步

你的问题应该是出在程序第十五行上:s2=h*((delt1/delt0)-sin(2*pi*delt1/delt0)/(2*pi)-(delt2/delt0));

将其中的delt2换成delt1便可纠正;