Can't plot exponential function

조회 수: 6 (최근 30일)
Ben Mai
Ben Mai 2020년 11월 11일
댓글: Ameer Hamza 2020년 11월 11일
clc;
X= (0:1:5);
Y=[2200*cos(9939.31*X)- 243.46*sin(9939.31*X)]*exp(-1100*X);
plot (X,Y)
I keep getting error on the function and not sure what I did wrong. Please help me find the error. Thank you

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 11월 11일
편집: Ameer Hamza 2020년 11월 11일
There are syntax issues with your code. Try the following code and compare it with your code to see the mistake
clc;
X= (0:1:5);
Y = (2200*cos(9939.31*X)-243.46*sin(9939.31*X)).*exp(-1100*X);
plot (X,Y)
  댓글 수: 2
Ben Mai
Ben Mai 2020년 11월 11일
It works. Thank you very much
Ameer Hamza
Ameer Hamza 2020년 11월 11일
I am glad to be of help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Stair Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by