Forum Discussion
Altera_Forum
Honored Contributor
13 years agoRead float values from file stored on SD Card
Hello all, I have a matrix with float values which I will be saving in a file from Matlab. I have to copy this file to SD Card and read these values using NIOS 2 while running my program. What ...
Altera_Forum
Honored Contributor
13 years agoSolved 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.