how to convert to binart file
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
given below is the values which i need to process.for that i need to save this as binary format. also i need to save as .tim format only..or any suggestions ..plz
7.543390 7.440341 35.278316 22.194822 978.857422 3.522650
7.543390 7.488090 35.278316 22.210081 978.857422 3.523718
7.527206 7.488090 35.293575 22.194822 978.857422 3.521430
7.527206 7.488090 35.293575 22.210081 978.857422 3.522803
7.527206 7.488090 35.293575 22.194822 978.857422 3.524024
7.527206 7.488090 35.293575 22.194822 978.875732 3.520972
7.527206 7.488090 35.293575 22.194822 978.857422 3.522955
7.527206 7.509514 35.293575 22.194822 978.875732 3.523566
7.532593 7.509514 35.293575 22.194822 978.875732 3.521430
7.532593 7.509514 35.293575 22.179564 978.875732 3.523261
7.532593 7.509514 35.293575 22.194822 978.875732 3.523871
output will be like this..
>Wi@hFy@éoBVåAÇpD–v@ @•z@@•z@@•z@@•z@@•z@@•z@
0 Kommentare
Antworten (1)
Walter Roberson
am 8 Apr. 2014
fid = fopen('YourFileNameHere', 'w');
fwrite(fid, YourMatrix, 'float32');
fclose(fid);
Note: you might need to pass transpose(YourMatrix)
I did not research .tim format; the file output format might be more complex than this.
dec2bin is not appropriate for this task.
2 Kommentare
Walter Roberson
am 9 Apr. 2014
your fopen() is failing when you want to fwrite(). You should be checking the output file identifier ("out" in your code), and you should consider printing out the reason code
[out, msg] = foen(fullfile(path_01, a(i).name),'w');
if out < 0
fprintf(2, 'Open to write failed because: %s\n', msg);
else
....
end
Siehe auch
Kategorien
Mehr zu Large Files and Big Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!