read the value of radio button with push button call back

1 回表示 (過去 30 日間)
Zine
Zine 2014 年 4 月 4 日
回答済み: Zine 2014 年 4 月 4 日
I created a programmatic gui that calls another gui (included in the same .m file), that second gui has several uicontrols and has a group of three radio buttons and a push button, I want to get which radio button is selected in the group when clicking the push button, I am a beginner with Matlab so I tried several methods but I did not achieve my objective, the push button call back is after the group creation code
how to do that please, Thanks in advance
  2 件のコメント
Jan
Jan 2014 年 4 月 4 日
Without seeing the code, it is hard to guess, what might help you efficiently. We cannot imagine e.g., if you store the handles by setappdata or guidata or perhaps in the figure's UserData. Please post more details and show, what you have tried already.
Zine
Zine 2014 年 4 月 4 日
Hi Jan, thanks for reply, I used first the simple code inside the pushbutton callback:
function []=pbtransvalid_Call(hObject, eventdata, handles,varargin)
global myData
value1 = get(handles.ksigmazero, 'value');
value2 = get(handles.sigmazero, 'value');
value3 = get(handles.nonzero, 'value');
if value1
myData.valt = 100;
elseif value2
myData.valt = 200;
elseif value3
myData.valt = 300;
end
myData is global data structure that I use for all the program declared in the first line of each function or callback as
global myData
if I send the initial status of the group it will not help because the user changes the status before pushing valid button, it sends an error message saying
Undefined function 'pbtransvalid_call' for input arguments of
type 'double'.
Error while evaluating uicontrol Callback

サインインしてコメントする。

採用された回答

Zine
Zine 2014 年 4 月 4 日
Thanks to whom answered and tried to answer me; I found a solution for that by using this answer just adjust it according to the problem

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by