Why is the array content displayed different from its input ?

1 回表示 (過去 30 日間)
Mallouli Marwa
Mallouli Marwa 2016 年 7 月 4 日
編集済み: Stephen23 2016 年 7 月 4 日
Hi
When i display this array : pl =[1 1 10.5e+10 3.4e-01 9e+03];
with the instruction disp(pl)
The result displayed is :
1.0e+11 * 0.0000 0.0000 1.0500 0.0000 0.0000
I don't understand why.
  1 件のコメント
Stephen23
Stephen23 2016 年 7 月 4 日
編集済み: Stephen23 2016 年 7 月 4 日
"Why is the array content displayed different from its input"
The displayed numbers are actually the same as the input ones. They are displayed using a common factor (in this case 1.0e+11). You can change how numbers are displayed: read the format documentation to know how to change this.

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2016 年 7 月 4 日
It's trying to have a common multiplier. Mine looks okay:
>> pl =[1 1 10.5e+10 3.4e-01 9e+03]
pl =
1 1 105000000000 0.34 9000
But I put these lines in my startup.m:
format long g;
format compact;
See what happens if you execute those lines first.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperators and Elementary Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by