.mat file to bin file
12 ビュー (過去 30 日間)
古いコメントを表示
Hi, I have recorded some WCDMA data using gnuradio and USRP which is in .bin format with 32bit floating point (both I and Q). I used octave to read that bin file and converted to .mat file so that it be imported into MATLAB. I did some signal processing on that data. Now I want that .mat file to be converted back to .bin file. I searched but couldn't succeed. Any pointers ?
Sumit
1 件のコメント
Walter Roberson
2024 年 12 月 17 日
".bin" as a file extension is not at all standardized. It can be used for any binary file format. We cannot advise on how to create .bin files without documentation on the exact file format.
回答 (2 件)
Walter Roberson
2024 年 12 月 20 日 20:40
Probably something like
filename = 'OUTPUTFILENAMEGOESHERE.bin';
[fid, msg] = fopen(filename, 'w');
if fid < 0; error('Failed to open "%" because "%s"', filename, msg); end
IQ = single([reshape(I, 1, []), reshape(Q, 1, [])]);
fwrite(fid, IQ, 'float32');
fclose(fid);
0 件のコメント
Pratik
2024 年 12 月 17 日
Hi Sumit,
To convert .mat file to bin file, dec2bin function can be used. Please refer to the following MATLAB Answers post which discusses about the same process:
1 件のコメント
Walter Roberson
2024 年 12 月 17 日
dec2bin is absolutely completely unrelated to the task of building .bin files.
参考
カテゴリ
Help Center および File Exchange で Data Import and Analysis についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!