My question is:
-I have created a panel with text in it :
uicontrol(handles.vehicleData, 'Style','text','Position', [148 -12 87 100], 'String',a,'FontSize',11);
-The variable a updates new values every time.
-Now I want to change the text in the panel without using the command uicontrol again. How can I do this?

 Akzeptierte Antwort

Rik
Rik am 6 Feb. 2019

0 Stimmen

You can use the handle:
%create text field
a='0';
h_txt=uicontrol(handles.vehicleData, 'Style','text','Position', [148 -12 87 100], 'String',a,'FontSize',11);
%change text
a='1';
set(h_txt,'String',a)

2 Kommentare

Mai Le Thai
Mai Le Thai am 6 Feb. 2019
Bearbeitet: Rik am 6 Feb. 2019
Thanks Rik!
Rik
Rik am 6 Feb. 2019
You're welcome

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2018b

Tags

Gefragt:

am 6 Feb. 2019

Kommentiert:

Rik
am 6 Feb. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by