필터 지우기
필터 지우기

Lose of Precision when storing values

조회 수: 3 (최근 30일)
laurie
laurie 2015년 3월 18일
댓글: Guillaume 2015년 3월 18일
I would like to store values into a 1x50 double array, but I loose precision where everything is stored in e+07. Is there a way to overcome this and store the full numbers?

채택된 답변

Michael Haderlein
Michael Haderlein 2015년 3월 18일
What do you mean, you loose precision? I guess you mean the numbers displayed in the command window, such as
x=[1e7 1.1]
x =
1.0e+07 *
1.0000 0.0000
No worries here, of course the second value is still 1.1, it's just not displayed:
>> x(2)
ans =
1.1000
If you want to get more digits displayed, check out the format function:
>> format long
>> x=[1e7 1.1]
x =
1.0e+07 *
1.000000000000000 0.000000110000000
Hope this helps!
  댓글 수: 1
Guillaume
Guillaume 2015년 3월 18일
I tend to use
format long g
which avoids scientific notation as much as possible.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by