필터 지우기
필터 지우기

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 CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by