Che334 Lecture 1
Che334 Lecture 1
INTRODUCTION
In this course, you will be introduced to
• the basics of the MATLAB interface.
• use the MATLAB command prompt for
performing calculations and creating
variables.
• work with lists of numbers, practice
constructing and manipulating lists of
vectors, and matrices.
• programming, and how to define
variables, store values in variables, and
changing the values of variables.
• DEFINITIONS:
• The name MATLAB stands for Matrix
Laboratory
• MATLAB is a high-performance
language for computation,
visualization, and programming in an
easy-to-use environment where
problems and solutions are expressed
in familiar mathematical notation.
• MATLAB allows you to solve many
technical computational problems,
especially those with matrix and vector
formulations.
• MATLAB was developed by the LINPACK
and EISPACK projects to provide easy
access to matrix software.
• In academic environment, it is the
standard instructional tool for
introductory and advanced courses
in mathematics, engineering, and
science.
• In industry, MATLAB is the tool of
choice for high-productivity research,
development, and analysis.
• MATLAB features a family of add-on
application called toolboxes that
allow you to learn and apply
specialized technology.
• Toolboxes are comprehensive
collections of MATLAB functions (M-
files) that extend the MATLAB
environment to solve particular
classes of problems.
• Many of these tools are graphical
user interfaces.
• It includes the MATLAB desktop and
Command Window, a command
history, an editor and debugger, a
code analyzer and other reports, and
browsers for viewing help, the
workspace, files, and the search
path.
The Basics: What is Programming
• Every computer is a machine.
It neither thinks nor
understands. It does exactly
what you want it to do but it
must be told what to do,
explicitly in its language.
• When you run MATLAB for the first time,
The Desktop is the 1st thing you will see. In
it you will see windows with names like
Workspace, Command History, Command
Window, and launch Pad. The important
one for now is the "Command Window."
To close all the others, open the "Desktop"
menu and unselect all selected options,
except for "Command Window.“
• You should have now, a single frame,
which is white, except for ">>" and, a
blinking cursor.
Numbers
• MATLAB uses conventional decimal
notation, with an optional decimal
point and leading plus or minus sign,
for numbers. Scientific notation uses
the letter e to specify a power-of-ten
scale factor. Imaginary numbers use
either i or j as a suffix. Some examples
of legal numbers are
• 3 -79 0.0021
• 5.4587268 2.73210e-20 5.00542e23
• 1i -3.14159j 3e5i
• Operators
• Expressions use familiar arithmetic
operators and precedence rules.
• + Addition
• - Subtraction
• * Multiplication
• / Division
• \ Left division (described in Matrices
and Linear Algebra in the MATLAB
documentation)
• ^ Power
• ' Complex conjugate transpose
• ( ) Specify evaluation order
Functions