Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
loading large MAT file

Subject: loading large MAT file

From: Nima

Date: 25 Dec, 2012 10:29:07

Message: 1 of 8

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

Subject: loading large MAT file

From: Thomas Clark

Date: 25 Dec, 2012 18:07:07

Message: 2 of 8

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 " <nimmaa@hotmail.com> wrote in message <kbbv5j$c5a$1@newscl01ah.mathworks.com>...
> 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

Subject: loading large MAT file

From: Nima

Date: 26 Dec, 2012 05:55:12

Message: 3 of 8

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.
  

Subject: loading large MAT file

From: Nima

Date: 26 Dec, 2012 05:58:07

Message: 4 of 8

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.
  

Subject: loading large MAT file

From: Bruno Luong

Date: 26 Dec, 2012 08:13:07

Message: 5 of 8

"Nima " <nimmaa@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

Subject: loading large MAT file

From: Nima

Date: 26 Dec, 2012 14:46:07

Message: 6 of 8

Hi Bruno,

It is 32 bit.

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kbebij$ase$1@newscl01ah.mathworks.com>...
> "Nima " <nimmaa@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

Subject: loading large MAT file

From: Nima

Date: 27 Dec, 2012 04:21:06

Message: 7 of 8

Hi Bruno,

It is 32 bit.

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kbebij$ase$1@newscl01ah.mathworks.com>...
> "Nima " <nimmaa@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

Subject: loading large MAT file

From: Bruno Luong

Date: 27 Dec, 2012 07:56:09

Message: 8 of 8

"Nima " <nimmaa@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

Tags for this Thread

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.

Contact us