为何在MATLAB中这个代码没法实现,应如何修改?clfx=0:pi/50:pi;y=cos(3*x).*exp(-x);plot(x,y,'b');str=['0.5';'1.5';'2.5 '];%求方程的三个根for i=1:3theX=fzero('cos(3*x)*exp(-x)',str(i,:)); plot(theX,0,'kd');legend('根')end

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/26 14:25:58
为何在MATLAB中这个代码没法实现,应如何修改?clfx=0:pi/50:pi;y=cos(3*x).*exp(-x);plot(x,y,'b');str=['0.5';'1.5';'2.5 '];%求方程的三个根for i=1:3theX=fzero('cos(3*x)*exp(-x)',str(i,:)); plot(theX,0,'kd');legend('根')end

为何在MATLAB中这个代码没法实现,应如何修改?clfx=0:pi/50:pi;y=cos(3*x).*exp(-x);plot(x,y,'b');str=['0.5';'1.5';'2.5 '];%求方程的三个根for i=1:3theX=fzero('cos(3*x)*exp(-x)',str(i,:)); plot(theX,0,'kd');legend('根')end
为何在MATLAB中这个代码没法实现,应如何修改?
clfx=0:pi/50:pi;y=cos(3*x).*exp(-x);plot(x,y,'b');str=['0.5';'1.5';'2.5 '];%求方程的三个根for i=1:3theX=fzero('cos(3*x)*exp(-x)',str(i,:)); plot(theX,0,'kd');legend('根')end

为何在MATLAB中这个代码没法实现,应如何修改?clfx=0:pi/50:pi;y=cos(3*x).*exp(-x);plot(x,y,'b');str=['0.5';'1.5';'2.5 '];%求方程的三个根for i=1:3theX=fzero('cos(3*x)*exp(-x)',str(i,:)); plot(theX,0,'kd');legend('根')end
x=[0:pi/50:pi];
str=[0.5;1.5;2.5];
可通过