Azzera filtri
Azzera filtri

How to set a title with uicontrol

12 visualizzazioni (ultimi 30 giorni)
Stefan
Stefan il 20 Gen 2014
Risposto: Walter Roberson il 20 Gen 2014
Hi, I am using uicontrol to create a box and to display some value say 5 in the box
box = uicontrol('Style', 'text','Units', 'norm', 'Position', [0.8 0.8 0.05 0.05]);
x=5;
set(box,'string', sprintf('%f', x));
Can someone explain how to set a title to it.
thanks.

Risposta accettata

Walter Roberson
Walter Roberson il 20 Gen 2014
There is no way to put a title in a uicontrol(). You can change the content you put in, though.
box_title = 'Probability cutoff:';
box = uicontrol('Style', 'text','Units', 'norm', 'Position', [0.8 0.8 0.05 0.05]);
x=5;
set(box,'string', sprintf('%s %f', box_title, x));

Più risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by