你可以采用textread函数。
For files with empty cells, use the emptyvalue parameter. Suppose
data.csv contains:
1,2,3,4,,6
7,8,9,,11,12
Read the file like this, using NaN in empty cells:
[data] = textread('data.csv','','delimiter',',','emptyvalue',NaN);
上面是帮助文件里面的,照着编写程序就可以读了。