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?

 Réponse acceptée

Rik
Rik le 6 Fév 2019

0 votes

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 commentaires

Mai Le Thai
Mai Le Thai le 6 Fév 2019
Modifié(e) : Rik le 6 Fév 2019
Thanks Rik!
Rik
Rik le 6 Fév 2019
You're welcome

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange

Produits

Version

R2018b

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by