How can I display a complex decimal result with actual precision value?

조회 수: 28(최근 30일)
I am trying to do arithmetic calculation with a number e=0.015923-0.03179523i iteratively to generate an encryption key which is to be expected a high precision complex decimal number. After calculation, I got the result only upto 4 decimal digits. I tried digits() but problem is that the result displayed according to the number given in digits(). I want the result with actual precision value. Please help.

채택된 답변

Steven Lord
Steven Lord 2016년 11월 3일
The default display format, format short, displays numbers "Short, fixed-decimal format with 4 digits after the decimal point." But note that this has no impact on how the numbers are stored and computed, which is to double precision. Change your display format if you want to see more decimal places.
If you want to compute your complex number using higher precision than double precision, use Symbolic Math Toolbox.
  댓글 수: 5

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

추가 답변(1개)

Brendan Hamm
Brendan Hamm 2016년 11월 3일
format long
will display the full numeric precision of all values at the command line.
  댓글 수: 1
Shafali 2016년 11월 4일
I tried format long also but it gave result only upto 15 decimal digits.

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

Community Treasure Hunt

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

Start Hunting!

Translated by