Graphical User Interfaces
By default, Matlab runs through a command line interface.
That is, individual
commands, functions or scripts are executed by typing instructions into the command
window and pressing enter.
For many years, this was the primary method for interacting
with a computer.
Contemporary applications of the command line interface still abound.
The DOS prompt in Microsoft’s command window, as well as the UNIX and Linux
operating systems, for example.
Since the 1990’s, however, the command line has been
replaced as the dominant method for computer control by the graphical user interface.
Popularized by Apple, and later Microsoft, the graphical user interface provides a more
user-friendly and intuitive means for human-computer interaction.
Long, text commands,
prone to error, have been replaced by clicks of the mouse on icons and buttons.
all programs you use today utilize graphical user interfaces.
Even Matlab’s command
window is encapsulated within such an interface.
Even though Matlab programming is
primarily designed for small groups of experienced users, the importance of graphical
user interfaces has necessitated their inclusion.
Matlab’s capabilities in regard to graphical user interfaces have evolved significantly
over the past few years.
Each subsequent release has included dramatic improvements
Therefore, the features discussed in this chapter may not be representative
for your version.
For the record, this chapter has been written based on the student
edition of Matlab, version 6.5, release 13.
11.1 Object-Oriented Programming
Any discussion of programming graphical user interfaces needs to begin with an
understanding of what goes on “behind the scenes”.
This involves a certain degree of
computer science theory.
These concepts are important, however, as they form the basis
of most major programming languages in use today.
To begin, graphical user interfaces became possible (and practical) thanks to the
development and spread of object oriented programming languages.
Programming (OOP) is a method of organizing data and the functions that operate on that
In the old days (a relative term, to be sure, as this means in the mid-to-late 80’s and
before), most languages had a strict separation between data and functions.
that gap by linking functions and their related data together.
This distinction may seem
trivial, but it was a revolutionary idea in computer science.
OOP allows for complicated
operations to be performed with simpler coding (in many, but not all cases).
It allows for
easier replication of code, improved efficiency and more rapid development.
has been that over the past decade, many previously widespread programming languages