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

86 次查看(过去 30 天)
rx
rx 2019-11-26
评论: Guillaume 2019-11-26
I want to plot the above equation in Matlab but i don't know how to plot.

回答(1 个)

Turlough Hughes
Turlough Hughes 2019-11-26
编辑:Turlough Hughes 2019-11-26
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 个评论
Guillaume
Guillaume 2019-11-26
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by