how to convert complex number into double number?
Mostrar comentarios más antiguos
I have got this complex value from result of an equation such :( 0.7803 + 0.0000i -0.3681 + 0.5659i 0.8562 + 0.0000i -0.8941 + 0.0428i 0.7861 + 0.0000i
0.0303 + 0.8492i 0.8508 + 0.0000i -0.5537 - 0.5875i 0.7910 + 0.0000i -0.7290 - 0.2247i)
i need to convert the result to double, How?
8 comentarios
John D'Errico
el 24 de En. de 2022
Editada: John D'Errico
el 24 de En. de 2022
They ARE double precision! The real part i double precision. The imaginary part is double precision.
You cannot just hide your head in the sand and pretend they are not complex though.
Arshub
el 24 de En. de 2022
Walter Roberson
el 24 de En. de 2022
real(x) imag(x) abs(x) ?
Arshub
el 24 de En. de 2022
John D'Errico
el 25 de En. de 2022
I'm sorry, but I think you are missing the point. If you need to compute a modular result from that and the variable is complex, then you did something wrong. That is why I said you should not just pretend it is real, and ignore the imaginary part. Closing your eyes to a problem does not make it go away. That only works when we are children, and even then...
Arshub
el 25 de En. de 2022
David Hill
el 25 de En. de 2022
We have no idea what you are trying to do. Some background would be helpful. You are obviously going to get complex results when cos(w) goes negative. You could force y to be positive by abs(cos(w)), but just like John said you cannot hide your head in the sand. We don't know what you are modeling or doing, so we can't help you.
Arshub
el 25 de En. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

