Link two button group with push button in Matlab GUIDE
Show older comments
Hi,
I am trying to obtain a GUI with basically two button groups (with two buttons each) and a push button. First button group allows to chose between two functions and the same for the button group pannel. The user must select one function from the first button group and another from the second one, then when push button is selected the convolution of the two functions is provided. I would like to know how to load the selected functions from the button pannels in the pushbutton callback.
This is part of the code:
% --- Executes when selected object is changed in uipanel1. function uipanel1_SelectionChangeFcn(hObject, eventdata, handles) if hObject==handles.rect f=rect(x); axes(handles.axes1) stem(x,f) end
if hObject==handles.sinc
f=sinc(x);
guidata(hObject,handles)
axes(handles.axes1)
stem(x,f)
end
% --- Executes when selected object is changed in uipanel5. function uipanel5_SelectionChangeFcn(hObject, eventdata, handles)
if hObject==handles.cos g = cos(x);
axes(handles.axes2)
stem(x,g,'r')
end
if hObject==handles.tri
g=tri(x);
axes(handles.axes2)
stem(x,g,'r','filled')
end
% --- Executes on button press in convolucion.
function convolucion_Callback(hObject, eventdata, handles)
g = convn(f,g,'same')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Thank you in advance.
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!