Path: news.mathworks.com!not-for-mail
From: "Vihang Patil" <vihang_patil@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: how to return a value after a pushbutton is pressed to main function
Date: Thu, 3 Jan 2008 11:17:38 +0000 (UTC)
Organization: Konem Solutions
Lines: 31
Message-ID: <flig8i$nlq$1@fred.mathworks.com>
Reply-To: "Vihang Patil" <vihang_patil@yahoo.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1199359058 24250 172.30.248.37 (3 Jan 2008 11:17:38 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 3 Jan 2008 11:17:38 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 842609
Xref: news.mathworks.com comp.soft-sys.matlab:444163


Hello 
I am trying to send a value to the main function after I 
press a pushbutton, but I am unable to do so
for example;

Create a small gui with 2 radiobuttons having tag viz, 
radiobutton1 and radiobutton2 and a pushbutton with tag 
pushbutton1

Now, after I press pushbutton1 I should be able to pass 
some values corresponding to the radiobbutton which  
is "On" to the main function. How do I do that. I am using 
GUIDE for doing this and I am not able to understand, 
whether I should use varargout for this purpose and how 
can I use it?

ex:
varargout = selection(varargin)

If I select radiobutton1 and press pushbutton1 then 
varargout should have string value "Radiobutton1 selected" 
and if radiobutton2 is selected then varargout should have 
string value "Radiobutton2 is selected".

Please guide
Thanks
Vihang