Refer to the image.
It has the question and answer attached to it.
If the result getting saved it correct, I wonder why the formatspecifier is wrong.

 採用された回答

madhan ravi
madhan ravi 2020 年 6 月 3 日

0 投票

%d

1 件のコメント

Bhoomi Shah
Bhoomi Shah 2020 年 6 月 3 日
編集済み: Bhoomi Shah 2020 年 6 月 3 日
Can try, thanks

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 6 月 3 日

2 投票

The file contains values that exceed 2^31-1 which is the limit for signed 32 bit integers. If you are required to read into 32 bit integers, then use '%u32'.
%d will not work for this; %d is the same as %d32 which is 32 bit signed integer.
Typically if you are not told to store as integer data types, you would most often use %f format to read into double. This is a bit risky in that values exceeding 2^53 might not be stored correctly, so you have to know the range of values you are expecting to know if it is reasonable to use double. If not then you would use %d64 or %u64

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by