I have a text file which have 5 columns. Here is sample data:
book 1 3 5 7
paper 3 9 0 2
pen 3 1 2 0
pencil 9 0 3 9
The first column contains character and the other columns are just number. The file contains several rows. I am trying to read that .txt as follows;
fileID = fopen('filename.txt');
C = textscan(fileID,'%s %n %n %n %n');
fclose(fileID);
celldisp(C)
It read the column correctly. However, it reads only the first row, and not all. Why it is happening that way? How to do if I want to read all rows and all columns. Thanks