Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

erroneous read data from grid file related to digits formatting

1 Ansicht (letzte 30 Tage)
pirapts Raptis
pirapts Raptis am 12 Jul. 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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

Antworten (0)

Diese Frage ist geschlossen.

Produkte


Version

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by