plot (t,y) ,dimension failure

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)

 Respuesta aceptada

the cyclist
the cyclist el 12 de Abr. de 2021
Editada: the cyclist el 12 de Abr. de 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)

Más respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 12 de Abr. de 2021

Editada:

el 12 de Abr. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by