The documentation for MATLAB claims that accessing memory-mapped files is faster than using standard I/O function like FREAD and FWRITE. When I write code using the MEMMAPFILE object, similar to the following,
m = memmapfile ('myfile.dat', 'Format', 'double' );for i = 1 : N y(i) = m.Data(i);end
I expect the above code to run faster than the following equivalent code:
fid = fopen ('myfile.dat', 'r' );for i = 1 : N y(i) = fread ( fid, 1, 'double' );endfclose( fid );
Best Answer