Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- Solved the problem myself using fwrite(fid,A,'float32'); in Matlab and using a union of char[4] and float in NIOS, thanks to stackoverflow.com union { char chars[4]; float f; } u; Read 4 bytes in u.char and use u.f, it will be exactly what's needed. --- Quote End --- If the endianess stored in the file by Matlab is the same as NIOS II endianess (it probably it is), you don't need the char[4] array, you can just read and write 4 bytes to and from the address of the float. BillA