MATLAB: How to set a title with uicontrol

MATLABuicontrol

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.

Best Answer

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));