hi. i have two guis main and sub . i have stored inputs from all the edit boxes in sub in a variable, var. i need to tranfer var to main gui.and use it for further logic.kindly help.

조회 수: 2 (최근 30일)
function data_Callback(hObject, eventdata, handles)
% hObject handle to data (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
points.T=str2double(get(handles.edit1,'userdata'));
points.ES=str2double(get(handles.edit2,'userdata'));
points.ISlower=str2double(get(handles.edit3,'userdata'));
points.ISupper=str2double(get(handles.edit4,'userdata'));
points.G=str2double(get(handles.edit5,'userdata'));
set(handles.data,'userdata',points);
close(details);
this is the call back of a pushbutton in sub.
i need to transfer the variable 'points' to main function pushbutton callback.

채택된 답변

Chandrasekhar
Chandrasekhar 2017년 11월 14일
편집: Chandrasekhar 2017년 11월 14일
Hi Alankrita, you can use assignin command to save the variables in base workspace and use evalin command to access them from the main gui
  댓글 수: 5
Chandrasekhar
Chandrasekhar 2017년 11월 15일
편집: Chandrasekhar 2017년 11월 15일
Hi, Please check the attached example.
Let me know if it is working :)

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2017년 11월 15일

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by