MATLAB: I need to create a binary file for a floating point numbers with single precisin and the output should be in the form of ieee754 format for the created binary file….could anyone help me

MATLAB

How to create a binary file for floating point numbers so that i need to fed this binary file as input to XILINX SDK…but the inputs here to be fed should be in the form of ieee754 single precision.Can anyone suggest me in creating this binary file

Best Answer

some_data = single( rand(1, 20) );
fid = fopen('YourFileName', 'w', 'ieee-be');
fwrite(fid, some_data, '*single');
fclose(fid);
Note: most parts of xilinx are big-endian, "ieee-be", but there are parts such as Microblaze talking to AXI that might work in little-endian, "ieee-le".
Related Question