MATLAB Answers

How to read 16-bit text with Matlab

136 ビュー (過去 30 日間)
Frank 2016 年 3 月 1 日
Commented: Brian Melgaard 2019 年 6 月 13 日
I have an Agilent 34970A data logger with their BenchLink software. This puts out a .csv file that Excel reads with no trouble. But Matlab cannot import it because it's 16 bit text. The first two bytes are 0xFF 0xFE, then after that every text byte is followed by a NULL (0x00). I wrote a function to read it, but I was hoping for the ability to read it directly, without having to programmatically skip the NULLs.

  0 件のコメント

サインイン to comment.


Walter Roberson
Walter Roberson 2016 年 3 月 1 日
MATLAB does not handle UTF-16LE files. You might wish to use the source code I posted in which reads csv files from any of the UTF-8 / UTF-16 / UTF-32 encodings

  4 件のコメント

表示 1 件の古いコメント
Stephen Cobeldick
Stephen Cobeldick 2016 年 3 月 2 日
Frank's "Answer" moved here:
Thanks, looks like a good solution. Interesting that it was posted a few days after I did my own workaround.
Jan 2017 年 8 月 12 日
+1, Thanks, Walter.
Brian Melgaard
Brian Melgaard 2019 年 6 月 13 日
Thanks !! Works very well.

サインイン to comment.

More Answers (0)

サインイン してこの質問に回答します。

Translated by