作业帮 > 综合 > 作业

matlab Conversion to double from sym is not possible

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/15 18:03:25
matlab Conversion to double from sym is not possible
w=2000;
theta=0:0.01:8*pi;
vc=2.*cos(theta).*w-2.*cos(theta).*2.*w.*sin(theta)./5./sqrt(1-0.16.*(cos(theta)).^2);
ac=-1600.*cos(2.*x)./(1-0.16.*(cos(x)).^2).^0.5-4000.*sin(x)+128.*cos(x).*sin(x).*sin(2.*x)./(1-0.16.*(cos(x)).^2).^1.5;
plot(theta,ac)
ac中变量x没有被定义;
在第三句后面换行加上: syms x;
最后一句polt(theta,ac)
改为ezplot(theta,ac)就可以了
再问: w=2000; x=0:0.01:8*pi; vc=2.*cos(x).*w-2.*cos(x).*2.*w.*sin(x)./5./sqrt(1-0.16.*(cos(x)).^2); syms x; ac=-1600.*cos(2.*x)./(1-0.16.*(cos(x)).^2).^0.5-4000.*sin(x)+128.*cos(x).*sin(x).*sin(2.*x)./(1-0.16.*(cos(x)).^2).^1.5; ezplot(x,ac) 为什么画出来的是条直线,不是应该是正弦函数那样的吗
再答: w=2000;x=0:0.01:8*pi;vc=2.*cos(x).*w-2.*cos(x).*2.*w.*sin(x)./5./sqrt(1-0.16.*(cos(x)).^2);ac=-1600.*cos(2.*x)./(1-0.16.*(cos(x)).^2).^0.5-4000.*sin(x)+128.*cos(x).*sin(x).*sin(2.*x)./(1-0.16.*(cos(x)).^2).^1.5;plot(x,ac)你既然变量x在前面定义了,那么就不要后面的定义了。