MATLAB: USBのセンサから出​力されたバイナリデー​タの変換方法を教えて​下さい

asciimatalabrs232cusbジャイロセンサバイナリ日本語

USB出力のジャイロセンサをPCに接続して使用しています。 Matlabのコマンドウィンドウから、以下のようにRAWデータの要求を行いデータが返ってきました。 しかしながら、肝心な測定データがバイナリデータのため文字化けしてしまいました。
また、RAWデータフォーマットは以下のようになっています。
データ型:X(ASCII) U(Unsigned) I(Signed)
バイナリデータから測定値に変換する方法を教えてください。 よろしくお願いします。

Best Answer

You should use fread() rather than fscanf() when you are working with binary. You should also be reading a specific number of bytes, rather than looking for a line terminator, as the line terminator can accidentally occur in the binary. You should configure BytesAvailableFcnMode to 'bytes'.