
To learn how to program a computer in a modern language with serious graphical capabilities,
is to take hold of a tool of remarkable flexibility that has the power to provide
profound insight. This text is primarily aimed at being a first course in programming, and
is oriented toward integration with science, mathematics, and engineering. It is also useful
for more advanced students and researchers who want to rapidly acquire the ability
to easily build useful graphical tools for exploring computational models. The MATLAB
programming language provides an excellent introductory language, with builtin graphical,
mathematical, and userinterface capabilities. The goal is that the student learns to
build computational models with graphical user interfaces (GUIs) that enable exploration
of model behavior. This GUI toolbuilding approach has been used at multiple educational
levels: graduate courses, intermediate undergraduate courses, an introductory engineering
course for firstyear college students, and high school junior and seniorlevel courses.
TheMATLAB programming language, descended from FORTRAN, has evolved to include
many powerful and convenient graphical and analysis tools. It has become an important
platform for engineering and science education, as well as research. MATLAB is a very
valuable first programming language, and for many will be the preferred language for most,
if not all, of the computational work they do. Of course, C++, Java, Python, and many
other languages play crucial roles in other domains. Several language features make the
MATLAB language easier for beginners than many alternatives: it is interpreted rather than
compiled; variable types and array sizes need not be declared in advance; it is not strongly
typed; vector, matrix, multidimensional array, and complex numbers are basic data types;
there is a sophisticated integrated development and debugging environment; and a rich set
of mathematical and graphics functions is provided.
While computer programs can be used in many ways, the emphasis here is on building
computational models, primarily of physical phenomena (though the techniques can be
easily extended to other systems). A physical system is modeled first conceptually, using
ideas such as momentum, force, energy, reactions, fields, etc. These concepts are expressed
mathematically and applied to a particular class of problem. Such a class might be, for
example, projectile motion, fluid flow, quantum evolution, electromagnetic fields, circuit
equations, or Newton’s laws. Typically, the model involves a set of parameters that describe
the physical system and a set of mathematical relations (systems of equations, integrals,
differential equations, eigensystems, etc.). The mathematical solution process must be
realized through a computational algorithm—a stepbystep procedure for calculating the
desired quantities from the input parameters. The behavior of the model is then usually
visualized graphically, e.g., one or more plots, bar graphs, or animations. 