How to set a title with uicontrol
3 views (last 30 days)
Show older comments
Stefan
on 20 Jan 2014
Answered: Walter Roberson
on 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.
0 Comments
Accepted Answer
Walter Roberson
on 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));
0 Comments
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!