How to extract just one value?

8 vues (au cours des 30 derniers jours)
jchris14
jchris14 le 25 Avr 2014
Commenté : jchris14 le 25 Avr 2014
Hi,
suppose I have a polynomial plot and find roots using the "roots" command and i get vector with 2 or more values. How do i just get one particular value out of the 2 or more values?
Thanks

Réponse acceptée

Walter Roberson
Walter Roberson le 25 Avr 2014
Index it. For example,
r = roots([9, 2, 4, -7]);
disp(r(1))
If you want to look for real roots then
r(imag(r)==0)
will return only real-valued roots
  1 commentaire
jchris14
jchris14 le 25 Avr 2014
Thanks Walter

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Polynomials dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by