Can't plot exponential function
5 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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)
Read about element-wise operators: https://www.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Stair Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!