MATLAB Creating Graphical User Interfaces

(ff) #1
If you add components and do not specify the Layout property, the grid places the
components in default locations. The components fill the grid from left to right and top to
bottom initially. For example, this code creates a 2-by-2 grid containing four components
in the default order.

f = uifigure;
g = uigridlayout(f);
g.RowHeight = {25,'1x'};
g.ColumnWidth = {100,'1x'};
b = uibutton(g,'Text','Open File');
dd = uidropdown(g,'Items',{'Scatter Plot','Line Plot'});
list = uilistbox(g,'Items',{'one','two'});
ax = uiaxes(g);

16 App Layout

Free download pdf