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

조회 수: 7 (최근 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에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by