Can't plot exponential function
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ben Mai
el 11 de Nov. de 2020
Comentada: Ameer Hamza
el 11 de Nov. de 2020
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 comentarios
Respuesta aceptada
Ameer Hamza
el 11 de Nov. de 2020
Editada: Ameer Hamza
el 11 de Nov. de 2020
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
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Stair Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!