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

4 lines
160 B
Mathematica
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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);