我想在Matlab中将一个普通的文本文件读入到单元数组中。我该怎么做?
我不需要任何格式,只需按字面意义阅读。
谢谢。
它将是基于行的数组,如100x1。
我不需要任何格式,只需按字面意义阅读。
谢谢。
它将是基于行的数组,如100x1。
example of reading : dd = {1;2;3}
使用textscan
函数,以便每行只有一个单元格元素:
fid = fopen('myFile.ext');
allData = textscan(fid,'%s','Delimiter','\n');
% allData{1} is a nLines-by-1 cell array with the lines of the file as text
read
、text
、file
、lines
等标签并不意味着您正在尝试从文本文件中读取行。请谨慎选择标签。 - Charles