필터 지우기
필터 지우기

GUIDE GUI desing

조회 수: 1 (최근 30일)
Sam
Sam 2012년 3월 21일
Hello Folks
I am trying to create a button that would launch "open file" functionality in order to save a ".mat" file , for use in the GUI.
the second issue i have, let's say i ahve popup menu that when one of its element is selected a certain algorithm is executed, this part i have done, but i want the algorithm function that has returned vector, to display one of its rows data in a text format in the GUI "say in a small frame"
i am using GUIDE. i am not sure if programmatic GUI works together with uicontrol object directly "i mean inside one of the function that gets generated in GUIDE"
  댓글 수: 3
Sam
Sam 2012년 3월 21일
tnks for ur response
for the second the problem i first did this
function popupmenu1_Callback(hObject, eventdata, handles)
str = get(hObject, 'String');
%val = get(hObject,'Value');
% Set current data to the selected data set.
switch str;
case 'Ellipsoidal Estimation' % User selects peaks.
Ellipsoidal_Algorithm;
case 'Recursive Least Square' % User selects membrane.
RLS_Algorithm;
end
% Save the handles structure.
guidata(hObject,handles)
that didn't cause the selection to launch the functions indicated in each switch case
then i did this
function Run_Callback(hObject, eventdata, handles)
str = get(hObject,'String');
CMP=strcmp(str,'Ellipsoidal Estimation');
if CMP==1
Ellipsoidal_Algorithm;
end
if CMP==0
RLS_Algorithm;
end
that didn't work either
Arthur
Arthur 2012년 3월 22일
You're not reading the value of the popup correctly. str = get(hObject,'String') will return all strings of the popup. In your case str = {'Ellipsoidal Estimation', 'Recursive Least Square'}. You will have to use v = get(hObject,'Value') to read at which position the popup is.
Did you try the solution I suggested here? http://www.mathworks.nl/matlabcentral/answers/32836-pop-up-menu-in-guide
I'm pretty sure that should work.

댓글을 달려면 로그인하십시오.

답변 (1개)

Aldin
Aldin 2012년 3월 21일
For first problem:
Write as Callback for your button this code:
[a,b] = uigetfile open([b,a])

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by