I don't understand why the following code doesn't work
for k = 1:4% Create a text file name, and read the file.
textFileName = ['A' num2str(k) '.txt']; if exist(textFileName, 'A') fid = fopen(textFileName, 'rt'); mydata = fread(fid); fclose(fid); else fprintf('File %s does not exist.\n', textFileName); endend
Best Answer