Hi Ante,
To my understanding you want to read a .asc file and iterate through the data. As the asc files contains character strings one can iterate through them and store into a cell array. In the code sample I iterate through the file one line at a time.
out = textread('test.asc','%s', 'delimiter', '\n');
C = cell2mat(out);
That just reads the whole file into a string, reading one line at a time. My test.asc was a sample asc file found Example ASC file - IBM Documentation.
For more information you can refer:
Hope it helps