I have a data file called imu_data.bin, I am parsing that file and after parsing getting three outputs inertial_data,time_stamp and raw_data the size of inertial data is 24 bytes for one sample , time stamp is 4 bytes for one sample and for raw data is 28 bytes for one sample. I am trying to write the inertial data after parsing to another file for the purpose I am using the following code
My code is
filename = 'imu_data.bin';[inertial_data,time_stamps,raw_data]=parse_imu_data(filename);fid = fopen('test2.bin', 'w');fwrite(fid, uint8(inertial_data), 'uint8'); % write data
fclose(fid);
As far as I concern after writting the code my output of the file test2.bin should be 24 bytes as I am writing only one sample but I am getting 8944 bytes. Let say it might be reading all the samples then the size of output file must contain nearly 35 thousand bytes as the total sample present in imu_data.bin is 1499.
I don't know why I am getting this pls help.
About my parsing file it is a pre existing file and the result after parsing are also correct and meeting the expected value.
Best Answer