Info

この質問は閉じられています。 編集または回答するには再度開いてください。

erroneous read data from grid file related to digits formatting

1 回表示 (過去 30 日間)
pirapts Raptis
pirapts Raptis 2019 年 7 月 12 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello everybody
i have a weird formated ascii file, that is quite similar with the one discussed here.
after removing all unrelated text from the file , I end up with a cell containgin all the numbers and i have to change it to double format.
in order to do that i use
data(:,:,i) = reshape( sscanf( blocks, '%4d' ), 1440, 720 ).' ;
the format is that data could be either 3 or 4 digit. when 3 digit, there is a whitespece before the value. when 4 digits are succesive the ascci looks like
559 584 656 84811281610184216791461128412291089 667 574
but matlab format the output as
559 584 656 8481 1281 6101 ...
instead of
559 584 656 848 1128 1610...
i have checked the output char and
the fisrt value is whitespace. and checked every 4th value (5,9 etc) for this line and seem correct (whitespace when 3 digit data, first digi when 4-digit data)/
i have tried replacing whitespaces with zeros
but still reads the same erroneous data.
so any idea of how to handle this would be really helpful

回答 (0 件)

この質問は閉じられています。

タグ

製品


リリース

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by