Choosing one answer from 3 in Solve

3 visualizaciones (últimos 30 días)
Behrang Tavousi
Behrang Tavousi el 19 de Sept. de 2015
Comentada: Behrang Tavousi el 19 de Sept. de 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

Respuesta aceptada

James Tursa
James Tursa el 19 de Sept. de 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

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by