plot (t,y) ,dimension failure

1 次查看(过去 30 天)
clear all; close all; clc;
delt=1/100;
t=0:delt:10;
y=exp(-t/2)*cos(t)
plot(t,y)
when I operate this code matlab program repeat me demension failure
y=exp(-t/2)*cos(t)

采纳的回答

the cyclist
the cyclist 2021-4-12
编辑:the cyclist 2021-4-12
The answer is right there in the error message. Use elementwise multiplication instead of matrix multiplication.
clear all; close all; clc;
delt=1/100;
t=0:delt:10;
y=exp(-t/2).*cos(t);
plot(t,y)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Entering Commands 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by