Path: news.mathworks.com!not-for-mail
From: "sfreeman " <crush35@gmx.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: GUI and workspace
Date: Fri, 28 Mar 2008 14:20:05 +0000 (UTC)
Organization: Daimler AG
Lines: 29
Message-ID: <fsiuql$3q0$1@fred.mathworks.com>
References: <fsit2b$8hv$1@fred.mathworks.com>
Reply-To: "sfreeman " <crush35@gmx.net>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1206714005 3904 172.30.248.38 (28 Mar 2008 14:20:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 28 Mar 2008 14:20:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 807112
Xref: news.mathworks.com comp.soft-sys.matlab:459667


"Hong " <honghaot@gmail.com> wrote in message 
<fsit2b$8hv$1@fred.mathworks.com>...
> Hi, I create a GUI to run my simulink model. However, 
there 
> is a problem when I tried to plot the figure at the end 
of 
> simulation. 
> 
> The call back function of GUI can't access the workspace 
> data generated by the simulation.
> 
> Therefore, my question is: how can I access the workspace 
> data in the GUI push button callback function.
> 
> Thanks in advance.


you may try to store the data - preferable per 'guidata' & 
a structure. You can find your GUI from a final Simulink 
function via a 'Tag' on the GUI main figure.

Then you should be able to access it in the uicontrol 
callback function via

data = guidata(gcbf)


alternative is to use appdata(0,...) instead of your GUI 
figure and guidata