Graphing poly2sym([1 2 3])

7 views (last 30 days)
John Harris
John Harris on 22 Feb 2015
Commented: John Harris on 22 Feb 2015
I've used this to try to graph, but it gives me an inaccurate graph. Attached is a picture of the graph that I'm getting, it shows (0,0) which must not be true for this function.
How could i graph this polynomial?
function test()
x=poly2sym([98 -280 235 -78 9]);
ezplot(x)
end

Answers (1)

Star Strider
Star Strider on 22 Feb 2015
What’s ‘inaccurate’ about it? What polynomial are you presenting to it, and what do you expect? The polynomial it evaluates is:
f(x) = 98*x^4 - 280*x^3 + 235*x^2 - 78*x + 9
  5 Comments
Andrew Newell
Andrew Newell on 22 Feb 2015
Edited: Andrew Newell on 22 Feb 2015
You can play around with the axes using the axis command. For example,
axis([0 2 -1 1])
clearly shows the roots, which you can get using
solve(x)
ans =
3/7
3/7
2^(1/2)/2 + 1
1 - 2^(1/2)/2
Note the double root at 3/7, which is why it just touches the axis.
John Harris
John Harris on 22 Feb 2015
Thank you this was just what I needed. I'm glad you told me there was a double root. I didn't notice but I needed to know

Sign in to comment.

Categories

Find more on Polynomials in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!