RosettaCodeData/Task/Read-entire-file/MATLAB/read-entire-file.m

4 lines
160 B
Matlab

fid = fopen('filename','r');
[str,count] = fread(fid, [1,inf], 'uint8=>char'); % s will be a character array, count has the number of bytes
fclose(fid);