load()只能读入每一行列数相等的数据
可以使用textread函数
具体用法在下面的链接
http://blog.sina.com.cn/s/blog_9e67285801010bju.html
我的数据可以通过跳行的方法
textread
基本语法是:
跳行
myfiles.txt 中的内容如下:
>> [data1,data2,data3,data4]=textread('myfiles.txt','%n%n%n%n','delimiter', ',','headerlines', 1);
>>
data =
textread中的headerlines指明了跳过几行,1可自由设定
这里headerlines告诉textread跳过一开始的1行,1可以替换为任意你要跳过的行数。
也可以通过屏蔽字符的方式
屏蔽字符
names =
types =
y =
answer =
对于iris.txt如果只想读取数据可用[data1,data2,data3,data4]=textread('Iris.txt','%f %f %f %f %*s',150,'delimiter',',');
____________________________________________________________________________________________
names =
levelnum =
x =
y =
answer =