Choosing one answer from 3 in Solve

3 次查看(过去 30 天)
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

采纳的回答

James Tursa
James Tursa 2015-9-19
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by