フィルターのクリア

Lose of Precision when storing values

16 ビュー (過去 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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by