Creating a simple plot
Mostrar comentarios más antiguos
Im trying to plot y=x*e^(-x^2) where the range of x is from -3,3
Ive tried running
x = -3:3; y = x*exp(-x.^2); plot (x, y) however i keep getting the error Inner matrix dimensions must agree. Not quite sure what that means
Respuesta aceptada
Más respuestas (2)
Michael Haderlein
el 1 de Oct. de 2014
You need element-wise multiplication:
x = -3:3;
y = x.*exp(-x.^2); %<-- here, I added the point
plot (x, y)
Vaultec
el 1 de Oct. de 2014
0 votos
Categorías
Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!