You are on page 1of 3

2016-CH-431

Hanzla Imran
Lab Manual
MATLA
MathWorks

University of Engineering & Technology


Introduction to MATLAB
Introduction:
MATLAB is a high-performance language for technical computing. It
integrates computation, visualization, and programming in an easy-to-use
environment where problems and solutions are expressed in familiar
mathematical notation.
The name MATLAB stands for matrix laboratory. MATLAB was
originally written to provide easy access to matrix.

Desktop Tools:
1- Command Window: Use the Command Window to enter variables and run
functions and M-files.

2- Command History: Statements you enter in the Command Window are


logged in the Command History. In the Command History, you can view
previously run statements, and copy and execute selected statements.

3- Current Directory Browser: MATLAB file operations use the current


directory reference point. Any file you want to run must be in the current
directory or on the search path.

4- Workspace: The MATLAB workspace consists of the set of variables


(named arrays) built up during a MATLAB session and stored in memory.
Basic Commands:
 clear Command: Removes all variables from workspace.
 clc Command: Clears the Command window and homes the cursor.
 Eye Command: Identity Matrix
 Abs Command: for Absolute Values
 Help Command: Matlab help documentation
 If Command: Conditionally execute statements
 Rand Command: for random values
 Inv Command: for Inverse
 Length Command: Length of a vector, see also size
 Log Command: Natural logarithm, also log10: common logarithm

Operators and Special Characters:


+ Plus; addition operator.
- Minus; subtraction operator.
* Scalar and matrix multiplication operator.
.* Array multiplication operator.
^ Scalar and matrix exponentiation operator.
.^ Array exponentiation operator.
\ Left-division operator.
/ Right-division operator.
.\ Array left-division operator.
./ Array right-division operator.
Colon; generates regularly spaced elements and represents an entire row or
:
column.
( ) Parentheses; encloses function arguments and array indices; overrides precedence.
[ ] Brackets; enclosures array elements.
. Decimal point.
… Ellipsis; line-continuation operator.
, Comma; separates statements and elements in a row.
; Semicolon; separates columns and suppresses display.
% Percent sign; designates a comment and specifies formatting.
_ Quote sign and transpose operator.
._ Nonconjugated transpose operator.
= Assignment (replacement) operator.

You might also like