(e^(-2x))-2x+1

9 visualizaciones (últimos 30 días)
rx
rx el 26 de Nov. de 2019
Comentada: Guillaume el 26 de Nov. de 2019
I want to plot the above equation in Matlab but i don't know how to plot.

Respuestas (1)

Turlough Hughes
Turlough Hughes el 26 de Nov. de 2019
Editada: Turlough Hughes el 26 de Nov. de 2019
Here's a plot of the function over the range of x = -2 to +2.
x=linspace(-2,2,1000);
y=exp(-2*x)-2*x+1;
plot(x,y)
I used linspace to generate 1000 values for x, which are equally spaced from -2 to 2, and then subbed these into your equation .
  1 comentario
Guillaume
Guillaume el 26 de Nov. de 2019
Another easy way to plot it:
fplot(@(x) exp(-2*x)-2*x+1)
or
fplot(@(x) exp(-2*x)-2*x+1, [-2 2])
to plot over the same range.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by