フィルターのクリア

Numbers of an Excel sheet are wrongly displayed in matlab

3 ビュー (過去 30 日間)
Nadja
Nadja 2023 年 2 月 13 日
コメント済み: Stephen23 2023 年 2 月 13 日
Hello,
I have an Excel Sheet with GDP data (in million). As I divided it, there are decimals. I already checked for accidently put on 1000 delimiters. But the sheet is formatted as my other sheets. And with them, matlab generates reasonable Output. If i look at the data on Matlab (Open the Excel in matlab and set the cursor on the scientific number), the right number is displayed. After matlab reads the data, the number is X times larger.
The relevant sheet is "GDP"
E.g. for Australia in 1993, the numeric matrix in matlab contains a value of 3.121381394041596e+05 (=312138139404159000000) instead of 312138,13940416.
Maybe i am too focused and do not see a "silly" mistake in the format but i tried so many things and it does not work.
I would really appreciate some help.
Thank you and kind regards
Nadja
  1 件のコメント
Stephen23
Stephen23 2023 年 2 月 13 日
"the numeric matrix in matlab contains a value of 3.121381394041596e+05 (=312138139404159000000)"
It is unclear how you get that large integer.
format long G
3.121381394041596e+05
ans =
312138.13940416

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

採用された回答

Sarah Gilmore
Sarah Gilmore 2023 年 2 月 13 日
Hi Nadja,
I believe the data is being imported correctly into MATLAB. 3.121381394041596e+05 is equal to 312138.13940416 - just written in scientific notation. To see this, you can change the display format of numbers to longG via the format command.
>> t = readtable("4_SWYZ_Market Capitalization 1993-2010.xlsx", "Sheet", "GDP");
>> format longG
>> t.x1993(1)
ans =
312138.13940416
I hope this helps.
Best,
Sarah

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by