How to read rows in an array of cells in matlab

I want to read a plain text file in an array of cells in matlab. How can i do this?

I do not want formatting. Reading like literals.

Thanks.

It will be an array based on strings, like 100x1

example of reading : dd = {1;2;3} 
+4
source share
1 answer

Use textscan to have one cell element per row:

 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 
+14
source

All Articles