2

我尝试了以下方法:

array = tdfread('file.txt');

该文件的结构是:

value1\tvalue2\tvalue3...

其中每个值可以是 -1 或 1。

无论如何,得到的结果是:

array = 

   x0x2D1: ''
  x0x2D11: ''
  x0x2D12: ''
  x0x2D13: ''
  x0x2D14: ''
  x0x2D15: ''
  x0x2D16: ''
  x0x2D17: ''
  x0x2D18: ''
  x0x2D19: ''
 x0x2D110: ''
 x0x2D111: ''
 x0x2D112: ''
 x0x2D113: ''
 x0x2D114: ''
 x0x2D115: ''
 x0x2D116: ''
 x0x2D117: ''
 x0x2D118: ''
 x0x2D119: ''
 x0x2D120: ''
 x0x2D121: ''
 x0x2D122: ''
 x0x2D123: ''
 x0x2D124: ''
 x0x2D125: ''
 x0x2D126: ''
 x0x2D127: ''
 x0x2D128: ''
 x0x2D129: ''
...

我不知道错误在哪里。

谢谢

4

1 回答 1

3

That's strange. You can try dlmread instead:

array = dlmread('file.txt', '\t');

Also note that dlmread is a native MATLAB function and doesn't require the Statistics Toolbox.

于 2013-06-13T10:54:45.887 回答