MATLAB Creating Graphical User Interfaces

(ff) #1
When you enter values for the density and volume of an object, and click the Calculate
button, the program calculates the mass of the object and displays the result next to
Mass(D*V).

To view the code for these user interface controls, open the template in the Layout Editor
and click the Editor button on the toolbar.

GUI with Axes and Menu

The following figure shows an example of this template.

When you click the Run button on the toolbar, the UI displays a plot of five lines, each
of which is generated from random numbers using the MATLAB rand(5) command. The
following figure shows an example.

6 Lay Out a UI Using GUIDE

Free download pdf