필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Check varaibles from other GUI functions?

조회 수: 1 (최근 30일)
Edmund Paul Malinowski
Edmund Paul Malinowski 2015년 11월 18일
마감: MATLAB Answer Bot 2021년 8월 20일
Hey all,
I'm trying to set up a GUI for my program and have a few issues. For one part of it, I have 3 radio buttons and a button in a button group. I've set up the functions for the selection change of the radio buttons and i set up a variable to be either 1, 2 or 3 depending on the selection but the button which performs the main part of the program seems to error when i try to read the variable from the radio button selection change function.. Below is my code so far:
% **********************************************
% OPTION BUTTONS SELECTION..
% **********************************************
% --- Executes when selected object is changed in uibuttongroup1.
function uibuttongroup1_SelectionChangedFcn(hObject, eventdata, handles)
% CHECK WHICH RADIO BUTTON IS SELECTED..
switch get(eventdata.NewValue,'Tag');
case 'OptUNFT'
FiltX = 1;
msgbox({'UNFILTERED NOTE..', num2str(FiltX)});
case 'OptISOLATE'
FiltX = 2;
msgbox({'ISOLATE NOTE..', num2str(FiltX)});
case 'OptFTNT'
FiltX = 3;
msgbox({'FILTER THE NOTE..', num2str(FiltX)});
end
% END SWITCH..
% **********************************************
% APPLY FILTER BUTTON..
% **********************************************
% --- Executes on button press in btAPLLYFT.
function btAPLLYFT_Callback(hObject, eventdata, handles)
% hObject handle to btAPLLYFT (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
switch FiltX;
case 1
msgbox('You chose to play the original');
case 2
msgbox('You chose to isolate');
case 3
msgbox('You chose to filter');
end
% END SWITCH..
By the way, i only have msgbox simply to check things are working as i go.. I don't know enough yet about matlab but in other languages, i'm sure it would be because FiltX is a local variable to that function, Is that right?
If its not this, how can i pass the FiltX value to the button press function..
Excuse my poor terminology haha..
Thanks,
Paul..

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by