Real solutions to a polynomial
Afficher commentaires plus anciens
Hi, I am stuck to this task: I am trying only to get the real solutions to the function
A = [1 -12 55 -120 124 -80]
B = roots(A)
4 commentaires
Scott MacKenzie
le 24 Avr 2021
Modifié(e) : Scott MacKenzie
le 24 Avr 2021
First of all
A = [1 -12 55 -120 124 -80]
is not a function. But
A = [1 -12 55 -120 124 -80]
B = roots(A)
yields
B =
4.699 + 0i
3.067 + 1.6505i
3.067 - 1.6505i
0.58351 + 1.031i
0.58351 - 1.031i
so, all the roots for the polynomial with the terms in A are imaginary, except the first:
>> isreal(B(1))
ans =
logical
1
Robert Bag
le 24 Avr 2021
Robert Bag
le 24 Avr 2021
Robert Bag
le 24 Avr 2021
Réponses (1)
A = randi([-9 9], 1, 6)
B = roots(A)
B(imag(B)==0)
Catégories
En savoir plus sur Digital Filter Analysis dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!