Filter löschen
Filter löschen

plot (t,y) ,dimension failure

1 Ansicht (letzte 30 Tage)
Mlee
Mlee am 12 Apr. 2021
Bearbeitet: the cyclist am 12 Apr. 2021
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)

Akzeptierte Antwort

the cyclist
the cyclist am 12 Apr. 2021
Bearbeitet: the cyclist am 12 Apr. 2021
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)

Weitere Antworten (0)

Kategorien

Mehr zu Entering Commands finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by