If I read from a file using the following code, MATLAB reads until the end of the file instead of the number of cycles specified:
fid = fopen('test.txt','r');N = int32(3);C = textscan(fid,'%s',N);
datadoubleendeoffileintegerMATLABoftextscantypetypecast
fid = fopen('test.txt','r');N = int32(3);C = textscan(fid,'%s',N);
Best Answer