MATLAB: UITable does not resize with rest of figure window

MATLAB

I have created the following uitable,
f = figure;
uitable(f, 'Data', rand(30,30));
When I resize the figure as a whole by clicking and dragging on the corner, the table does not get resized with the rest of the window.

Best Answer

For any figure component to automatically resize, you must change its "Units" property to "normalized."
The default position units are in "pixels" which obviously don't scale with the figure itself. Once you have change "Units" to "normalized, you can reset the "Position" property as appropriate.