I want to plot F(x) and G(x) in same graph for x=(-10,10) how can I do this?

조회 수: 5 (최근 30일)
Arkesh Patel
Arkesh Patel 2018년 2월 22일
댓글: Roger Stafford 2018년 2월 23일
f(x)=5x^2+9x+2
G(x)=3x+12
  댓글 수: 1
James Tursa
James Tursa 2018년 2월 22일
편집: James Tursa 2018년 2월 22일
What have you done so far? What specific problems are you having with your code? Do you know how to evaluate polynomials for a vector input? Do you know how to plot?

댓글을 달려면 로그인하십시오.

답변 (2개)

Star Strider
Star Strider 2018년 2월 23일
See the documentation on Anonymous Functions (link) and the linspace (link) function.

Roger Stafford
Roger Stafford 2018년 2월 23일
x = linspace(-10,10);
f = 5*x.^2+9*x+2;
G = 3*x+12;
plot(x,f,'r-',x,G,'g-')

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by