Hello,
I would like to have following 2 functions written in Matlab (here the C-code):
void getMemoryFromFloat(float floatNumber,char memory[4]){ // floatNumber is input, memory is output memory[0]=((char*)&floatNumber)[0]; memory[1]=((char*)&floatNumber)[1]; memory[2]=((char*)&floatNumber)[2]; memory[3]=((char*)&floatNumber)[3];}float getFloatFromMemory(char memory[4]){ // memory is input return(((float*)memory)[0]);}
Anyone can give me a hint? To give a quick background, I basically communicate with a C-library that sends me float data that is coded in a string. In a similar way, that library only accepts float data coded in a string.
Thanks!
Best Answer