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:
Save a .mat file from GUI

Subject: Save a .mat file from GUI

From: nick

Date: 1 Sep, 2010 12:01:22

Message: 1 of 4

Hello,

I have a GUI and in one handles, I saved a matrix.
Now, I want to save the content of the matrix into a .MAT file.
I have the path in which I want to save the file, but I don't know how to save the content of the handles into a file.

Any ideas ?

I tried to use save, but I think that I used it wrong. :D


Thanks,

Subject: Save a .mat file from GUI

From: ImageAnalyst

Date: 1 Sep, 2010 12:46:58

Message: 2 of 4

nick:
I wouldn't recommend saving your handles structure in a mat file
because if you ever recalled it, it might blow away some important
object handles in your current process, which may be different numbers
than the last time you ran the program. I'd recommend you extract out
that array and save just that.

myMatrix = handles.myMatrix;
myMatFullFileName = fullfile(myFolder, 'myBaseMatFileName.mat');
save(myMatFullFileName, 'myMatrix');

Subject: Save a .mat file from GUI

From: Sean

Date: 1 Sep, 2010 12:47:04

Message: 3 of 4

"nick " <nickname2890117@yahoo.com> wrote in message <i5lfai$ina$1@fred.mathworks.com>...
> Hello,
>
> I have a GUI and in one handles, I saved a matrix.
> Now, I want to save the content of the matrix into a .MAT file.
> I have the path in which I want to save the file, but I don't know how to save the content of the handles into a file.
>
> Any ideas ?
>
> I tried to use save, but I think that I used it wrong. :D
>
>
> Thanks,

Well show us how you used save so we can diagnose it. That's the route I take when saving from a GUI.

Subject: Save a .mat file from GUI

From: nick

Date: 2 Sep, 2010 16:48:06

Message: 4 of 4

Thanks a lot, but I resolved my problem. The first solution was ok. :)

"Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <i5li08$aqv$1@fred.mathworks.com>...
> "nick " <nickname2890117@yahoo.com> wrote in message <i5lfai$ina$1@fred.mathworks.com>...
> > Hello,
> >
> > I have a GUI and in one handles, I saved a matrix.
> > Now, I want to save the content of the matrix into a .MAT file.
> > I have the path in which I want to save the file, but I don't know how to save the content of the handles into a file.
> >
> > Any ideas ?
> >
> > I tried to use save, but I think that I used it wrong. :D
> >
> >
> > Thanks,
>
> Well show us how you used save so we can diagnose it. That's the route I take when saving from a GUI.

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