|
I believe I have found a bug, and I hope the developers will kindly
provide a clarification or a patch.
I use Matlab2008b on Vista64. When I try to access a large file, >3GB,
and specify the Format as [ny nx], a strange error message is given.
If I try to access the same file linearly as an ny*nx array, it works
alright. The problem appears only for large files. Please copy-paste
the code below, but first you need to compile James'
preallocatefile.c, which takes a few seconds using mex.
Thanks
Igor
% evaluate this to recreate the problem
nx=17473;
ny=51905;
filename = 'test';
%{
create file with given size, using the mex function in
[how to preallocate/resize file]
http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/b4ef4a839af3e6b0/
%}
% this will take some time
preallocatefile(filename ,ny*nx*4);
mmf = memmapfile(filename, 'Format', 'single')
% this works:
mmf.Data(1)
clear mmf;
mmf = memmapfile(filename, 'Format', {'single', [ny nx], 'x'})
mmf.Data.x(1)
% that gives an error:
%{
??? Error using ==> subsref
Insufficient number of outputs from right hand side of equal sign to
satisfy assignment.
Error in ==> memmapfile.memmapfile>memmapfile.subsref at 626
varargout{1} = hSubsref(obj.dataHandle, s(2:end));
%}
|