Writing a value of variable into edit text filed in GUIDE

조회 수: 1 (최근 30일)
Fedor Durnev
Fedor Durnev 2020년 4월 7일
댓글: Fedor Durnev 2020년 4월 7일
Hi!
I have created a pushbutton and edit_text fields through GUIDE. After tapping on pushbutton, some plots are built and one variable is calculated.
My problem is that I need to display this variable into edit_text field each time, when I tap on pushbutton. I know only how to work with variables, when edit_text is used as input field. In my case I want to make it as output field. Maybe should I use static_text instead and if yes, how can I display this variable into it?
How can I solve this problem?
Thank you!
  댓글 수: 2
Subhamoy Saha
Subhamoy Saha 2020년 4월 7일
The way you are getting input from edit_text field, in a similar way you can display output to this field.
Suppose your output numeric variable is a.
set(handles.edit_text,'String',num2str(a))
Here edit_text is the name of the callback function of edit_text field.
Considering a as a numeric variable it has been converted to string (not necessary).
Fedor Durnev
Fedor Durnev 2020년 4월 7일
Yes, "set", I forgot about this magic function, thank you!

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Word games에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by