plot (t,y) ,dimension failure

조회 수: 1 (최근 30일)
Mlee
Mlee 2021년 4월 12일
편집: the cyclist 2021년 4월 12일
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