Matlab读取数据和分割字符
按行读取数据:
fid=fopen(‘filename’,‘读取模式’);
if(fid==-1)
disp(‘读取错误’);
return;
end
for i=1:行数
data{i}=fgets(fid);
end
*如果需要将每行的数据进行分割,则使用分割函数:
*
*S=regexp(str,‘char’,‘split’);
*
其中,str是需要分割的字符,char需要根据自己的需求填...
原创
2020-04-18 11:58:11 ·
2721 阅读 ·
0 评论