how to represent the roots of a polynomial on a graph?

 Accepted Answer

p=[1 2 3 4 5]; % your polynomial x^4+2x^3+3x^2+4x+5
r=roots(p)
scatter(real(r),imag(r),'filled','red')

2 Comments

Many thanks for your answer, But if I want the real roots only what should I write? thank you in advance.

Sign in to comment.

More Answers (1)

Categories

Community Treasure Hunt

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

Start Hunting!