Thread Subject: GUI and m-files. Sharing data between them

Subject: GUI and m-files. Sharing data between them

From: Mario Ruz

Date: 8 Aug, 2008 20:13:02

Message: 1 of 4

Hi everybody,

I am developing a GUI for making a comparative between some
results, which are done in other m-files. This m-files also
need to change some parameters of a simulink model.

So, i have a GUI, some m-files, and a simulink model. The
GUI is not very complex, I have an axes figure for ploting
the simulation and a few buttons for selecting the
appropiate algorithm (this is, a call to a code stored in
one of the m-files, which will change parameters and
simulate the simulink model, and will produce some
variables).

Having said that, my problem is: I don't know how to pass
the data obtained from the m-files to the GUI, and then
work with them INSIDE the GUI. How can i do that?

I know i could use nested functions, but in that case the m-
file would be very big. Also some functions are .p
extension and i dont have access to the code.

I have looked on the web but i dont find an example or a
clear response (i know it's related with handles data).

Any help will be very useful.

Kind regards, Mario.

Subject: GUI and m-files. Sharing data between them

From: bogfrog

Date: 8 Aug, 2008 21:39:25

Message: 2 of 4

One way to do it is to use the application data commands. (getappdata(), setappdata(), etc)

Watch this little video:

http://blogs.mathworks.com/pick/2005/10/03/guide-video-part-two/


I've been using this approach for a medium sized project I'm working on. There may be more elegant ways of handling the problem.

Subject: GUI and m-files. Sharing data between them

From: Mario Ruz

Date: 9 Aug, 2008 02:34:02

Message: 3 of 4

Thanks BogFrog,

In fact, i have seen that video today. I?ll reply if i
could figure out my problem. Anyway, if someone has any
other way for my problem it would be nice to know.

Thanks. Mario

bogfrog <jmcgraw@rcn.com> wrote in message
<9146404.1218231596450.JavaMail.jakarta@nitrogen.mathforum.o
rg>...
> One way to do it is to use the application data commands.
(getappdata(), setappdata(), etc)
>
> Watch this little video:
>
> http://blogs.mathworks.com/pick/2005/10/03/guide-video-
part-two/
>
>
> I've been using this approach for a medium sized project
I'm working on. There may be more elegant ways of handling
the problem.

Subject: GUI and m-files. Sharing data between them

From: Ashwini Deshpande

Date: 9 Aug, 2008 03:49:01

Message: 4 of 4

"Mario Ruz" <mario_ruz@hotmail.com> wrote in message
<g7ivmq$85d$1@fred.mathworks.com>...
> Thanks BogFrog,
>
> In fact, i have seen that video today. I?ll reply if i
> could figure out my problem. Anyway, if someone has any
> other way for my problem it would be nice to know.
>
> Thanks. Mario
>
> bogfrog <jmcgraw@rcn.com> wrote in message
> <9146404.1218231596450.JavaMail.jakarta@nitrogen.mathforum.o
> rg>...
> > One way to do it is to use the application data commands.
> (getappdata(), setappdata(), etc)
> >
> > Watch this little video:
> >
> > http://blogs.mathworks.com/pick/2005/10/03/guide-video-
> part-two/
> >
> >
> > I've been using this approach for a medium sized project
> I'm working on. There may be more elegant ways of handling
> the problem.
>


Hai,

Another way is defining the variables as global so that u
can refer them from any m-files present in that folder. Just
 tryout ..if u cant make it out ... i will give u an example..

HTH,
Ashwini

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
gui MRR 8 Aug, 2008 16:15:12
guide MRR 8 Aug, 2008 16:15:12
mfiles MRR 8 Aug, 2008 16:15:12
sharing data MRR 8 Aug, 2008 16:15:12
rssFeed for this Thread

Contact us at files@mathworks.com