How do i plot this quadratic graph?

조회 수: 14 (최근 30일)
Yaseen Noaman
Yaseen Noaman 2020년 11월 22일
편집: Stephan 2020년 11월 23일
I'm trying to plot this quadratic graph. For some reason it looks like this. It's not crossing the x axis for some reason the x axis are down. I need to fix it please.
This is the graph and the code.
  댓글 수: 2
Setsuna Yuuki.
Setsuna Yuuki. 2020년 11월 22일
that depends on the values of "a" "b" and "c", perhaps those values do not allow zero crossing.
Yaseen Noaman
Yaseen Noaman 2020년 11월 22일
They do. A is 1 b is -2 c is -4. They do cross the x axis

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

답변 (1개)

Stephan
Stephan 2020년 11월 23일
편집: Stephan 2020년 11월 23일
x = -10:10;
y = polyval([1 -2 -4],x);
plot(x,y)
r = roots([1 -2 -4])
text(r(1),0,'\leftarrow Root')
text(r(2),0,'\leftarrow Root')

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by