Hello,
I have code that does the following:
- Uses uipickfile to get a file name
- Reads the selected file to get the data.
- Stops running at this time to display a uipanel button group (previously invisible) with the possible sample rates FOR THIS FILE. Naturally, with these groups one button is already selected, which has the default sample rate. Unfortunately the sample rate not included in the file.
I would like to either (a) associate a "Done" or "OK" button with the uipanel to say, after the right sample rate is selected, that it's OK to go on, or (b) tell things to proceed after either the default OR another sample rate is selected. Then, I can go ahead and Plot Data (with the right time scale).
I have tried Zheng's post, http://www.mathworks.com/matlabcentral/answers/62438-how-can-i-use-a-push-button-callback-function-to-call-radio-button-group-s-selectionchangefcn
This seemed to jump ahead and not let the selection change occur.
Thanks in advance!
Doug Anderson
Oh… the code for what I tried to to with Zheng's suggestions:
% --- Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)% hObject handle to pushbutton10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% When pushed,
% set(handles.pushbutton10,'Visible','off');
switch get(get(handles.uipanel2,'SelectedObject'),'Tag') % Get Tag of selected object.
case 'sr_1024_radiobutton' handles.sample_rate = 1024; case 'sr_2048_radiobutton' handles.sample_rate = 2048; case 'sr_4096_radiobutton' handles.sample_rate = 4096; case 'sr_8000_radiobutton' handles.sample_rate = 8000;endset(handles.Plot_Data,'Enable','on'); guidata(hObject,handles);
Best Answer