Intro. to MatLab
Intro. to MatLab
• The name MATLAB stands for MATrix LABoratory. MATLAB was written
originally to provide easy access to matrix software developed by the
LINPACK (linear system package) and EISPACK (Eigen system package)
projects.
A number of frequently used variables are already defined when MATLAB is started.
Some of the predefined variables are:
• ans A variable that has the value of the last expression that was not assigned to a
specific variable If the user does not assign the value of an expression to a variable,
MATLAB automatically stores the result in ans.
• pi The number π.
• eps The smallest difference between two numbers. Equal to 2^(–52), which is
approximately 2.2204e–016.
• inf Used for infinity.
• i Defined as , which is: 0 + 1.0000i.
• j Same as i.
• NaN Stands for Not-a-Number. Used when MATLAB cannot determine a valid
numeric value. Example: 0/0.
USEFUL COMMANDS FOR MANAGING VARIABLES
Command Outcome
• clear Removes all variables from the memory.
• clear x y z Removes only variables x, y, and z from the memory.
• who Displays a list of the variables currently in the memory.
• whos Displays a list of the variables currently in the memory and
their sizes together with information about their bytes and class