Only the real part of the complex number is displayed

조회 수: 13 (최근 30일)
Diana
Diana 2021년 1월 13일
댓글: Diana 2021년 1월 13일
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
Diana
Diana 2021년 1월 13일
편집: Diana 2021년 1월 13일
I'm using eig(A), E should have complex numbers but its not showing the complex numbers
KSSV
KSSV 2021년 1월 13일
What is your A matrix?

댓글을 달려면 로그인하십시오.

채택된 답변

Steven Lord
Steven Lord 2021년 1월 13일
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
Diana
Diana 2021년 1월 13일
I thought it would reduce the displayed numbers to 2 digits .. how can I do that?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Filter Banks에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by