Thread Subject: memmapfile multidimensional access is broken for large files

Subject: memmapfile multidimensional access is broken for large files

From: rych

Date: 18 Jan, 2009 14:49:10

Message: 1 of 1

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));
 %}

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com