How can I efficiently handle binary data in UDP packets using instrument control toolbox?

1 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Instrument Control Toolbox Supported Hardware 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by