MATLAB Intro
MATLAB Intro
Algorithm development
Data acquisition
MATLAB is an interactive system whose basic data element is an array that does not require
dimensioning. It allows you to solve many technical computing problems, especially those
with matrix and vector formulations, in a fraction of the time it would take to write a program
in a scalar noninteractive language such as C or FORTRAN.
The name MATLAB stands for matrix laboratory. MATLAB was originally written to
provide easy access to matrix software developed by the LINPACK and EISPACK projects.
Today, MATLAB engines incorporate the LAPACK and BLAS libraries, embedding the
state of the art in software for matrix computation.
MATLAB has evolved over a period of years with input from many users. In university
environments, 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.
Key Features
This part of MATLAB is the set of tools and facilities that help you use and become more
productive with MATLAB functions and files. Many of these tools are graphical user
interfaces. It includes: the MATLAB desktop and Command Window, an editor and
debugger, a code analyzer, and browsers for viewing help, the workspace, and folders.
The Language
The MATLAB language is a high-level matrix/array language with control flow statements,
functions, data structures, input/output, and object-oriented programming features. It allows
both "programming in the small" to rapidly create quick programs you do not intend to reuse.
You can also do "programming in the large" to create complex application programs intended
for reuse.
Graphics
MATLAB has extensive facilities for displaying vectors and matrices as graphs, as well as
annotating and printing these graphs. It includes high-level functions for two-dimensional and
three-dimensional data visualization, image processing, animation, and presentation graphics.
It also includes low-level functions that allow you to fully customize the appearance of
graphics as well as to build complete graphical user interfaces on your MATLAB
applications.
External Interfaces
The external interfaces library allows you to write C and FORTRAN programs that interact
with MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking),
for calling MATLAB as a computational engine, and for reading and writing MAT-files.
Documentation
The MATLAB program provides extensive documentation, in both printable and HTML
format, to help you learn about and use all of its features.
Data Import and Export — Retrieving and storing data, memory-mapping, and
accessing Internet files
Data Analysis — Data analysis, including data fitting, Fourier analysis, and time-
series tools
Graphics — Tools and techniques for plotting, graph annotation, printing, and
programming with Handle Graphics® objects
3-D Visualization — Visualizing surface and volume data, transparency, and viewing
and lighting techniques
Creating Graphical User Interfaces — GUI-building tools and how to write callback
functions
C and Fortran API Reference — Covers functions used by the MATLAB external
interfaces, providing information on syntax in the calling language, description,
arguments, return values, and examples
Release Notes — New features, compatibility considerations, and bug reports for
current and recent previous releases
In addition to the documentation, you can access demos for each product from the Help
browser. Run demos to learn about key functionality of MathWorks™ products and tools.
Functions
Functions are evaluated element wise, as in the sin(t) example above. For example, if we type
>> t = linspace(0,4pi,9); then t is a vector containing 9 time samples. If we then type
>> x = sin(t), then MATLAB creates the vector x with 9 values corresponding to the sin of
each of the elements of the vector t, i.e. x = 0 1 0 -1 -0 1 0 -1 0
Operators
Since MATLAB generally deals with matrices, you must be careful when using operators like
“*” or “/”. If you want these operators to operate in an element-by-element fashion you have
to denote this by a leading period, e.g.“.*” and “./” !
Generating Matrices
MATLAB also provides several commands to generate matrices. Try out the following.
>> A = [1 2 3; 4 5 6; 7 8 9]
>> B = eye(3)
>> C = ones(2,3)
>> D = zeros(3,2)