Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

loading large MAT file

673 views
Skip to first unread message

Nima

unread,
Dec 25, 2012, 5:29:07 AM12/25/12
to
Hi,

I happen to have a very large .mat file(2.8GB)..I am trying to open using a VM which has 16 GB. But I cant seem to do that.The following command results as:

load file.mat
gives
??? Error using ===> load
Can't read file /home/....../file.mat

I will be happy to provide further information.

Thank you

Thomas Clark

unread,
Dec 25, 2012, 1:07:07 PM12/25/12
to
Hi Nima,

Various versions of MATLAB have increasingly (over time) supported 'large' format MAT files. Provided you have MATLAB v7.3 or later (that's quite old now, so you probably have) you ought to be OK. Type ver at the command line to check.

Go to MATLAB, Preferences, General, MAT Files and check that the file was saved with the -v7.3 option... as that might be the origin of a problem (if that's unchecked on the version of MATLAB that created the file).

Next, is that 16GB of physical RAM that the VM has access to? Or is it based on swap space/hard drive? Check the settings of the VM and ensure that it's not just the VM size (which represents the size of the hard drive the VM can access - the RAM accessible by the VM might be different).

Hope you get it sorted

Tom







"Nima " <nim...@hotmail.com> wrote in message <kbbv5j$c5a$1...@newscl01ah.mathworks.com>...

Nima

unread,
Dec 26, 2012, 12:55:12 AM12/26/12
to
Hi Thomas,

Thank you for you answer.
1)My matlab version is 7.13

2)The MAT file I have was created by someone else and if I see the date its dated on 2009 July. Is there a way I can confirm the version or modify the version.

3)I even tried to access the content in parts.

whos -file model.mat gives me Name Size Bytes Class Attributes

C 1064x193410 1646305920 double
avg 193410x1 1547280 double
coeffs 193410x1064 1646305920 double

But when I do
matObj = matfile('model.mat');

[nrows,ncols] = size(matObj,'coeffs'); l

loadedData = matObj.coeffs(nrows-10:nrows, ncols-10:ncols);

results in Can't read file /home/.../model.mat.

However, if I try to load avg (less memory ) it runs normally.

4)As for the memory, 16 GB is the size of accessible RAM.

Thank you again.

Nima

unread,
Dec 26, 2012, 12:58:07 AM12/26/12
to

Bruno Luong

unread,
Dec 26, 2012, 3:13:07 AM12/26/12
to
"Nima " <nim...@hotmail.com> wrote in message <kbe3g0$fh0$1...@newscl01ah.mathworks.com>...
> Hi Thomas,
>
> Thank you for you answer.
> 1)My matlab version is 7.13
>

32 or 64 bit?

Bruno

Nima

unread,
Dec 26, 2012, 9:46:07 AM12/26/12
to
Hi Bruno,

It is 32 bit.

"Bruno Luong" <b.l...@fogale.findmycountry> wrote in message <kbebij$ase$1...@newscl01ah.mathworks.com>...

Nima

unread,
Dec 26, 2012, 11:21:06 PM12/26/12
to
Hi Bruno,

It is 32 bit.

"Bruno Luong" <b.l...@fogale.findmycountry> wrote in message <kbebij$ase$1...@newscl01ah.mathworks.com>...

Bruno Luong

unread,
Dec 27, 2012, 2:56:09 AM12/27/12
to
"Nima " <nim...@hotmail.com> wrote in message <kbgibi$87p$1...@newscl01ah.mathworks.com>...
> Hi Bruno,
>
> It is 32 bit.
>

That might be a problem. The 32-bit version might not be able to read mat-file created by 64-bit version, due to the limitation of the 32-bit address.

Bruno

Aifei Liu

unread,
Oct 27, 2015, 9:39:12 AM10/27/15
to
Thanks for your indications. I find the solution by the following way.

matObj = matfile('model.mat');
loadedData = matObj(1:1000, 1:1000);

Thanks a lot!


"Nima " <nim...@hotmail.com> wrote in message <kbe3g0$fh0$1...@newscl01ah.mathworks.com>...
0 new messages