How can I efficiently handle binary data in UDP packets using instrument control toolbox?
1 view (last 30 days)
Show older comments
I am reading binary packets using the instrument control toolbox's udp object. My plan is to read the full packet as binary data and use typecast to modify the data to other types as necessary. matlab/fread supports specifying the precision with an asterisk to indicate that the output should use the same format as the input (i.e. '*uint8' means read 8-bit values and return 8-bit values instead of converting each 8-bit value to double), but instrument/fread does not. The documentation says 'By default, numeric values are returned in double-precision arrays.'
Is there some way to specify a different return type for instrument/fread? Or do I really have to receive doubles and then convert them back to the desired type? (My guess is that bit would be a performance killer.)
matlab/fread also supports 'machinefmt'. Is there a way to take advantage of that with instrument/fread?
0 Comments
Answers (0)
See Also
Categories
Find more on Instrument Control Toolbox Supported Hardware in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!