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:
Access data from a .mat-file with memmapfile.m

Subject: Access data from a .mat-file with memmapfile.m

From: Markus Due Jakobsen

Date: 6 May, 2011 12:26:04

Message: 1 of 4

Hi

How is it possible to access the data saved as a .mat file with memmapfile.m?

Let’s say we do the following:
>> A=1:10;
>> save('A.mat','A')

However, how can I access the vector from my memmapfile-object.
>> M=memmapfile('A.mat','format',??,??)

In line with this I have another question, is it possible to access a structed field in a .mat with memmapfile.
Ex. A.a =1:10;

Kind regards
Markus

Subject: Access data from a .mat-file with memmapfile.m

From: Markus Due Jakobsen

Date: 3 Aug, 2011 15:24:29

Message: 2 of 4

Any suggestions?

A=ones(10);
save('A.mat','A')
M=memmapfile('A.mat','format',??,??)
How can I access the vector from my memmapfile-object?


"Markus Due Jakobsen" wrote in message <iq0pcs$bfr$1@newscl01ah.mathworks.com>...
> Hi
>
> How is it possible to access the data saved as a .mat file with memmapfile.m?
>
> Let’s say we do the following:
> >> A=1:10;
> >> save('A.mat','A')
>
> However, how can I access the vector from my memmapfile-object.
> >> M=memmapfile('A.mat','format',??,??)
>
> In line with this I have another question, is it possible to access a structed field in a .mat with memmapfile.
> Ex. A.a =1:10;
>
> Kind regards
> Markus

Subject: Access data from a .mat-file with memmapfile.m

From: Scott

Date: 3 Aug, 2011 15:36:10

Message: 3 of 4

"Markus Due Jakobsen" wrote in message <j1bp7d$e5d$1@newscl01ah.mathworks.com>...
> Any suggestions?
>
> A=ones(10);
> save('A.mat','A')
> M=memmapfile('A.mat','format',??,??)
> How can I access the vector from my memmapfile-object?
>
>
> "Markus Due Jakobsen" wrote in message <iq0pcs$bfr$1@newscl01ah.mathworks.com>...
> > Hi
> >
> > How is it possible to access the data saved as a .mat file with memmapfile.m?
> >
> > Let’s say we do the following:
> > >> A=1:10;
> > >> save('A.mat','A')
> >
> > However, how can I access the vector from my memmapfile-object.
> > >> M=memmapfile('A.mat','format',??,??)
> >
> > In line with this I have another question, is it possible to access a structed field in a .mat with memmapfile.
> > Ex. A.a =1:10;
> >
> > Kind regards
> > Markus

Markus,

The MATLAB documentation refers to memmapfile as utilizing simple binary files consisting of standard formats (int8, uint8, single, double etc) as .dat files. The .mat files used by MATLAB are sort of a proprietary HDF format and there are many other things in them like attribute strings and info structure etc. I'm not sure memmapfile can handle them. The docs for memmapfile are pretty good and worth taking a look at.

hth,
Scott

Subject: Access data from a .mat-file with memmapfile.m

From: Malcolm Lidierth

Date: 14 Nov, 2011 14:03:11

Message: 4 of 4

The MAT-file utilities form the FEX have been updated to provided support for fread and for memmapfile and matfile objects. Example
y=nmatrix('myfile.mat', 'x');
memory maps variable x from file and allows partial i/ousing standard MATLAB matrix syntax: y(1:10), y(:,:,1:5,:) etc.

See http://sourceforge.net/projects/waterloo/files/

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