Here's my GUIDE.
I have two different callbacks for the changing the radio button values (for enabling and disabling the edit boxes) and the clicking of push button.
The problem is that I want to determine which radio button is checked when I press the push button. I tried passing the variable with the codes below (the first three...)
function pbAudio_Callback(hObject, eventdata, handles)
x = getRBValue(rbValue);
if(strcmp(x,'rbRecord'))
myAudio = wavrecord(get(handles.edtSeconds,'String')*11025,11025);
end
wavplay(myAudio)
function pnlAudio_SelectionChangeFcn(hObject, eventdata, handles)
slctdBtn = get(eventdata.NewValue,'tag')
getRBValue(slctdBtn);
switch slctdBtn
case 'rbRecord'
set(handles.edtSeconds,'enable','on');
set(handles.edtPath,'enable','off');
case 'rbImport'
set(handles.edtSeconds,'enable','off');
set(handles.edtPath,'enable','on');
end
function getRBValue(rbValue1)
rbValue = rbValue1;
Unfortunately, I am receiving the error below.
Undefined function or variable 'rbValue'.
Error in untitled>pbAudio_Callback (line 79)
x = getRBValue(rbValue);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in untitled (line 43)
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)untitled('pbAudio_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback