How would you plot y=x^(2)e^(-x2)?

 Respuesta aceptada

Star Strider
Star Strider el 8 de Jul. de 2017

2 votos

Try this:
x = linspace(-5, 5);
y = x.^2 .* exp(-(x.^2));
figure(1)
plot(x, y)
grid
Experiment to get the result you want. See the documentation on the various functions for details on what they can do and how to use them.
Also, you must use element-wise operations here. See the documentation on Array vs. Matrix Operations (link) for details.

Más respuestas (1)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 8 de Jul. de 2017

Respondida:

el 13 de Mzo. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by