Only the real part of the complex number is displayed

4 visualizaciones (últimos 30 días)
Diana
Diana el 13 de En. de 2021
Comentada: Diana el 13 de En. de 2021
When I have a complex number as an output, Mtalab either doesn't display the number or only shows the real part. Any idea how can I fix that
  3 comentarios
Diana
Diana el 13 de En. de 2021
Editada: Diana el 13 de En. de 2021
I'm using eig(A), E should have complex numbers but its not showing the complex numbers
KSSV
KSSV el 13 de En. de 2021
What is your A matrix?

Iniciar sesión para comentar.

Respuesta aceptada

Steven Lord
Steven Lord el 13 de En. de 2021
I believe you're using the bank display format (format bank) which does not show the imaginary parts of numbers. What would $4.56i represent?
A = [1 -2; -3 4]
format
sqrt(A) % shows imaginary part in default format, format short
ans = 2×2
1.0000 + 0.0000i 0.0000 + 1.4142i 0.0000 + 1.7321i 2.0000 + 0.0000i
format bank
sqrt(A) % shows in bank format
ans = 2×2
1.00 0.00 0.00 2.00
  1 comentario
Diana
Diana el 13 de En. de 2021
I thought it would reduce the displayed numbers to 2 digits .. how can I do that?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by