Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Function questions
Date: Sat, 9 May 2009 07:42:02 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 15
Message-ID: <gu3c4a$ob1$1@fred.mathworks.com>
References: <gu3a8b$pet$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
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 1241854922 24929 172.30.248.38 (9 May 2009 07:42:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 9 May 2009 07:42:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:538625


I keep this message for copy and past now and then:

Functions in GUI, like any other functions, have their own private workspace. They are not shared, and they are clear when the (nested) function ends.

To pass data among functions in Gui (it can be many guis), we have to use one of these options:

- GUIDATA
- SET/GETAPPDATA
- SET/GET on the field USERDATA of graphic handles of your GUI
- GLOBAL variables
- ASSIGNIN/EVALIN

The first ones are preferred methods. The two last are to be avoided.

Bruno