How can extract only real values of a matrix

48 Ansichten (letzte 30 Tage)
Tinkul
Tinkul am 8 Apr. 2014
Kommentiert: Ravikumar Bharti am 17 Apr. 2020
After some oprations i have got a matrix which contains imaginary value also. But i need only the
matrix containing real values. How can i remove imaginary values from that matrix? For eg.
A=[18.0000;-3.8090 + 4.3920i;-2.6910 + 1.4001i;-2.6910 - 1.4001i;-3.8090 - 4.3920i]
But my output contains only real values
A=[18.000;-3.8090;-2.6910;-2.6910;-3.8090]
Please help

Akzeptierte Antwort

Mischa Kim
Mischa Kim am 8 Apr. 2014
Tinkul, use
real(A)

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by