Link two button group with push button in Matlab GUIDE
显示 更早的评论
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!