Interfacing .m file and GUI .m file
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Hello all, I new to MATLAB GUI. I am facing difficulty in changing text of 'Edit Text' box in GUI.What I am doing based on a condition in .m script file (not GUI .m file) I want to change text in 'Edit Text' Box. I have tried with get command but not succeeded. Here is my dummy code : Please suggest some solution
% Main .m File-----------
global hu
hu= 0;
for i =1:10
if i >5
hu =1;
else
hu = 0;
end
Change % my gui . m file
end
--------------------------------------------
% GUI .m file
function Change_Callback(hObject, eventdata, handles)
% hObject handle to Change (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Change as text
% str2double(get(hObject,'String')) returns contents of Change as a double
global hu
if hu==1
set(hObject,'String','OFF');
end
---------------
I have also tried with finding object using findobj('Tag','Change') and then try to change string using set command but not found any success. here 'Change' is my Tag for edit box
0 件のコメント
回答 (0 件)
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!