0% found this document useful (0 votes)
32 views

Matlab: Olawale B. Akinwale

This document provides an overview of MATLAB, including its history, strengths, weaknesses, and key features. It discusses how MATLAB was originally developed in the 1970s to provide access to linear algebra subroutines without requiring Fortran knowledge. It gained popularity through word of mouth and was commercialized by The MathWorks in the 1980s. The document outlines MATLAB's strengths like ease of use and optimized matrix operations, as well as weaknesses like limited general purpose programming. It also describes key MATLAB components like the workspace, command history, variables, and matrix manipulation commands.

Uploaded by

Azhar Hussain
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Matlab: Olawale B. Akinwale

This document provides an overview of MATLAB, including its history, strengths, weaknesses, and key features. It discusses how MATLAB was originally developed in the 1970s to provide access to linear algebra subroutines without requiring Fortran knowledge. It gained popularity through word of mouth and was commercialized by The MathWorks in the 1980s. The document outlines MATLAB's strengths like ease of use and optimized matrix operations, as well as weaknesses like limited general purpose programming. It also describes key MATLAB components like the workspace, command history, variables, and matrix manipulation commands.

Uploaded by

Azhar Hussain
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 12

MATLAB

lecture 2
Olawale B. Akinwale
Dept of Electronic & Electrical
Engineering
Obafemi Awolowo University, Ile-Ife
History for MATLAB
• Fortran subroutines for solving linear (LINPACK)
and eigenvalue (EISPACK) problems
• Developed primarily by Cleve Moler in the 1970’s
• Later, when teaching courses in mathematics,
Moler wanted his students to be able to use
LINPACK and EISPACK without requiring
knowledge of Fortran
• MATLAB developed as an interactive system to
access LINPACK and EISPACK
History for MATLAB (cont’d)
• MATLAB gained popularity primarily through
word of mouth because it was not officially
distributed
• In the 1980’s, MATLAB was rewritten in C with
more functionality (such as plotting routines)
• The Mathworks, Inc. was created in 1984
• The Mathworks is now responsible for
development, sale, and support for MATLAB
• The Mathworks is an employer that hires co-ops
through our co-op program
Strengths of MATLAB
• MATLAB is relatively easy to learn
• MATLAB code is optimized to be relatively
quick when performing matrix operations
• MATLAB may behave like a calculator or as a
programming language
• MATLAB is interpreted, errors are easier to fix
• Although primarily procedural, MATLAB does
have some object-oriented elements
Weakness of MATLAB
• MATLAB is NOT a general purpose
programming language
• MATLAB is an interpreted language (making it
for the most part slower than a compiled
language such as C++)
• MATLAB is designed for scientific computation
and is not suitable for some things (such as
parsing text)
Workspace
• Allows access to data

• Area of memory managed through the


Command Window

• Shows Name, Size (in elements), Number of


Bytes and Type of Variable
Current Directory
• MATLAB functions can be called from any
directory.
• By default, MATLAB calls functions from a
number of directories located in the MATLAB
path.
• Your programs are only available if the current
directory is the one that they exist in or if that
directory has been added to the MATLAB
path.
Command History
• Shows a list of all commands which have
previously been used in the command
window.
• Allows access to the commands used during
this session, and possibly previous sessions
• Clicking and dragging to the Command
window allows you to re-execute previous
commands
Variables
• Types of variables include:
– Vector
– Matrix
– Structure
– Cell array
• There is no need to specify the type of a
variable when defining the variable.
Defining Variables
• A cell array is defined simply as
a = 5 or b = - 8

• An array (or a vector) can be defined as:


a = [1 2 3 4 5]; or a = [1,2,3,4,5]; or a = 1:1:5;
or a = 1:5;
Defining Variables (cont’d)

• Matrices are defined much like vectors,


except each row is delimited by a semicolon.
For example:
A = [ 1 2 3; 3 8 9; 2 9 3] gives
A=[123
389
2 9 3]
• Structures will be dealt with later in the course.
Matrix Manipulation
• Addition
• Multiplication
• Division
• Determinant
• Inverse
• Transpose / conjugate transpose
• Selecting an element, row or column

You might also like