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일

1 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

제품

질문:

2021년 4월 12일

편집:

2021년 4월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by