Choosing one answer from 3 in Solve

3 vues (au cours des 30 derniers jours)
Behrang Tavousi
Behrang Tavousi le 19 Sep 2015
Commenté : Behrang Tavousi le 19 Sep 2015
i solved a eq with command solve() and get answer -1.35-4.59i , -0.136-4.59i , 1.18+9.18e-41i
i need just real part of positive answer,1.18 from these answers. i want to store this answer in Array, but i have get error because there are 3 answers
thanks

Réponse acceptée

James Tursa
James Tursa le 19 Sep 2015
To get the real part of the 3rd element, e.g.,
>> x = [-1.35-4.59i , -0.136-4.59i , 1.18+9.18e-41i]
x =
-1.3500 - 4.5900i -0.1360 - 4.5900i 1.1800 + 0.0000i
>> real(x(3))
ans =
1.1800
  1 commentaire
Behrang Tavousi
Behrang Tavousi le 19 Sep 2015
thanks,helpful <3

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by