Hey everyone, I would really appreciate your help as I am struggling on a (seems to be silly) question. I am working on communication between two heterogenous systems. Specifically one of them is high-level programmed through simulink while the second is completely implemented in C. Communication happens over UDP packers through the Realtime UDP that only accepts bytestreams as its input. In order to transmit double values from matlab to C, simulinks converts the double value to an array of an uint8 using typecast with something like
v = typecast(5.57, 'uint8').
My question is, how I should go back to the original double value, in native C code, once the uint8 array has been received from the second system?
I already tried to generated a kindofcode that reverts typecast applying
typecast(received, 'double')
using codegen. It didn't work, obviously 🙂
Thank you so much, Best Luca
Best Answer