pop up activation with push button
Show older comments
Hi guys, please help!
I have created two pop up menus (in GUI over guide), and I want to create plot (filter type) based on the user selection. This plot should be created by push button.
I have made following code (bellow), but it doesn't work, even though there are no errors reported.
function prikazfitra_Callback(hObject, eventdata, handles)
u = get(handles.filterMenu,'value'); %get currently selected option from menu
v = get(handles.vrstafiltMenu,'value'); %get currently selected option from menu
if u == 2 && v == 1
d=str2double(get(handles.d,'string'));
r=str2double(get(handles.r,'string'));
Wn=2*d/handles.fs;
b=fir1(r,Wn);
% plot frekvencijskog odziva filtra
axes(handles.grafik2);
plot(b,1:length(b)); grid;
freqz(b,1);
elseif u == 2 && v == 2
%stuff here
elseif u == 2 && v == 3
%stuff here
elseif u == 2 && v == 4
%stuff here
elseif u == 3 && v == 1
%stuff here
elseif u == 3 && v == 2
%stuff here
elseif u == 3 && v == 3
%stuff here
elseif u == 3 && v == 4
%stuff here
end
not all elseif are shown. u and v are selections from pop up menu. d and r are edit with number value.
Thanks!
1 Comment
Walter Roberson
on 26 Sep 2020
I recommend using the debugger to trace the execution.
Answers (0)
Categories
Find more on App Building 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!