Adjust Programmatic UI Layouts Interactively
uicontrol and do not specify a Position, their location is always [20 20 60 20] (in
pixels). That is, if you keep creating them with default positions, they lie on top of one
another.
Align Components Horizontally
The following statement moves the push buttons horizontally to the right of their
bounding box. It does not alter their vertical positions. The figure shows the original
bounding box.
align([b1 b2 b3],'Right','None');
Align Components Horizontally While Distributing Them Vertically
The following statement moves the push buttons horizontally to the center of their
bounding box and adjusts their vertical placement. The 'Fixed' option makes the
distance between the boxes uniform. Specify the distance in points (1 point = 1/72 inch).
In this example, the distance is seven points. The push buttons appear in the center of
the original bounding box. The bottom push button remains at the bottom of the original
bounding box.
align([b1 b2 b3],'Center','Fixed',7);