作业帮 > 综合 > 作业

matlab语句找错a=0.1;b=0.5;t=-10:0.01:10;y=sin(t)^2*exp(-a*t)-b*a

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/07 14:37:53
matlab语句找错
a=0.1;b=0.5;t=-10:0.01:10;
y=sin(t)^2*exp(-a*t)-b*abs(t);
这个语句运行为什么有错误呢?
Error using ==> mpower
Matrix must be square.
语句没有错,
>> a=0.1; b=0.5; t=-10:0.01:10;
y = sin(t).^2.*exp(-a*t)-b*abs(t);
>> y
y =
Columns 1 through 7
-4.1955 -4.2160 -4.2362 -4.2561 -4.2757 -4.2950 -4.3140
Columns 8 through 14
-4.3327 -4.3510 -4.3690 -4.3866 -4.4039 -4.4208 -4.4374
Columns 15 through 21
-4.4535 -4.4693 -4.4847 -4.4997 -4.5142 -4.5284 -4.5421
Columns 22 through 28
-4.5555 -4.5683 -4.5808 -4.5928 -4.6043 -4.6154 -4.6261
.