3 A Simple Programmatic UI
Create a Simple UI Programmatically
This example shows how to create a simple UI programmatically, such as the one shown
here.
Subsequent topics guide you through the process of creating this UI.
If you prefer to view and run the code that created this UI without creating it, set your
current folder to one to which you have write access. Copy the example code and open it
in the Editor by issuing the following MATLAB commands:
copyfile(fullfile(docroot, 'techdoc','creating_guis',...
'examples','simple_gui2*.*')), fileattrib('simple_gui2*.*', '+w');
edit simple_gui2.m
Note:This code uses dot notation to set graphics object properties. Dot notation runs in
R2014b and later. If you are using an earlier release, use the set function instead. For
example, change f.Visible = 'on'; to set(f,'Visible','on').