Reputation: 23860
I want to read a regular text file into cell array at the matlab. How can i do that ?
I don't want any formatting. Reading as literals.
Thank you.
It will be row based array like 100x1
example of reading : dd = {1;2;3}
Upvotes: 4
Views: 12820
Reputation: 74940
Use textscan
, so to have one cell element per line:
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
Upvotes: 16