matlab 报错 求指导x=0:0.0001:1;y=[1/(i*6.24375)]*[(-2.93*exp(i*1.373*x)-0.05)]*exp(-x/58.213)+[1/(i*5.747)*exp(-x/58.213)]-[1/(i*8.003)*exp(-x/13.222)*exp(i*1.08*x)];z=abs(y);plot(x,z);总是报错啊Error using ==> mtimesInner matrix dimensions
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/26 01:54:55
matlab 报错 求指导x=0:0.0001:1;y=[1/(i*6.24375)]*[(-2.93*exp(i*1.373*x)-0.05)]*exp(-x/58.213)+[1/(i*5.747)*exp(-x/58.213)]-[1/(i*8.003)*exp(-x/13.222)*exp(i*1.08*x)];z=abs(y);plot(x,z);总是报错啊Error using ==> mtimesInner matrix dimensions
matlab 报错 求指导
x=0:0.0001:1;
y=[1/(i*6.24375)]*[(-2.93*exp(i*1.373*x)-0.05)]*exp(-x/58.213)+[1/(i*5.747)*exp(-x/58.213)]-[1/(i*8.003)*exp(-x/13.222)*exp(i*1.08*x)];
z=abs(y);
plot(x,z);
总是报错啊
Error using ==> mtimes
Inner matrix dimensions must agree.
Error in ==> Untitled at 2
y=[1/(i*6.24375)]*[(-2.93*exp(i*1.373*x)-0.05)]*exp(-x/58.213)+[1/(i*5.747)*exp(-x/58.213)]-[1/(i*8.003)*exp(-x/13.222)*exp(i*1.08*x)];
>>
怎么改呢?
matlab 报错 求指导x=0:0.0001:1;y=[1/(i*6.24375)]*[(-2.93*exp(i*1.373*x)-0.05)]*exp(-x/58.213)+[1/(i*5.747)*exp(-x/58.213)]-[1/(i*8.003)*exp(-x/13.222)*exp(i*1.08*x)];z=abs(y);plot(x,z);总是报错啊Error using ==> mtimesInner matrix dimensions
x=0:0.0001:1;
y=arrayfun(@(x)[1/(i*6.24375)]*[(-2.93*exp(i*1.373*x)-0.05)]*exp(-x/58.213)+[1/(i*5.747)*exp(-x/58.213)]-[1/(i*8.003)*exp(-x/13.222)*exp(i*1.08*x)],x);
z=abs(y);
plot(x,z);
xlabel('$x$','interpreter','latex','fontsize',15);%使用latex字体
ylabel('$z$','interpreter','latex','fontsize',15);