作业帮 > 综合 > 作业

matlab错误求救>> x1=0:0.01:5; y1=x1*exp(-2*x1); subplot(1,2,1);

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/13 09:11:30
matlab错误求救
>> x1=0:0.01:5;
y1=x1*exp(-2*x1);
subplot(1,2,1); plot(x1,y1,’r’);
x2=-2:0.01:2;
y2=5*cos(3*pi*x2);
subplot(1,2,2); plot(x2,y2,’b’);
? Error using ==> mtimes
Inner matrix dimensions must agree.
>>  x1=0:0.01:5; y1=x1.*exp(-2*x1);%%x1后面改为点乘 subplot(1,2,1); plot(x1,y1,'r');%%r的单引号用英文法输入 x2=-2:0.01:2; y2=5*cos(3*pi*x2);subplot(1,2,2); plot(x2,y2,'b');%%b的单引号用英文法输入