For Programmers: Free Programming Magazines  


Home > Archive > Matlab > October 2006 > Re: How to save and load variables in GUI applicat









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: How to save and load variables in GUI applicat
Garrett

2006-10-31, 7:10 pm

I would use the save and load commands like you were trying. What
kind of trouble are you having with that in the GUI? Could you
provide the code and error message?

- - Garrett

The other option is to have your GUI actually overwrite it's own
m-file, but that seems more like a problem for a solution.
Jason Wang

2006-10-31, 7:10 pm

Thanks for reply. I figured it out. My purpose was to store some
variables in a .mat file, and later extract them from it using load.
All these are to be used in GUI coding.

Here are the example codes:
var1 = 5;
var2 = 'Hello';
save ('test.mat', 'var1', 'var2');

Now extract the variables from the file:
S = load('test.mat');
S.var1
S.var2

Once I found out I can load the variable into a structure S, then the
question is solved.

Jason

Garrett wrote:
>
>
> I would use the save and load commands like you were trying. What
> kind of trouble are you having with that in the GUI? Could you
> provide the code and error message?
>
> - - Garrett
>
> The other option is to have your GUI actually overwrite it's own
> m-file, but that seems more like a problem for a solution.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com