Filter löschen
Filter löschen

How to set a title with uicontrol

12 Ansichten (letzte 30 Tage)
Stefan
Stefan am 20 Jan. 2014
Beantwortet: Walter Roberson am 20 Jan. 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.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 20 Jan. 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));

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by