Beruflich Dokumente
Kultur Dokumente
To MATLAB
What is MATLAB?
MATrix LABoratory Does Matrix Operations Thousands of inbuilt functions ToolBoxes GUIS A programming Language
A complete software package Simulink Modeling tools EDA tools
LAYOUT
A Simple Start:
Add two Variables
No definitions needed, no classes needed On command window type:
>>A=5; >>B=4; >>C=A+B;
C=9
Editors:
Editors are used to store codes
Code is nothing but just a set of lines M Files are used in MATLAB having extension .m
Set of code lines A code implementing some functions like sin, cos exp (they are inbuilt)
Function File
Defining Matrices:
Just write all the entries separated by the space or
comma and enclosed in a bracket [] A=[1 2 3 2] Or A=[1,2,3,2] For column matrix, put semicolon ; in between A=[1;2;3;2]
Importance of Matrix:
Not just as a transformation Also set of data or samples Electrical Signals Performance outputs Images Also as model representation Polynomials Transfer functions Neural Networks
Polynomials:
Polynomials in MATLAB
A polynomial can be represented in the form of
You have to just write [1 2 2 5] Each number represents the value of coefficients.
I N P U T
Transfer Functions
Neural Systems
Systems modeled as a set of transformation with
with MALTAB
Define Matrixs
Mix , and ; to make 2 D matrix
A=[1:100];
Colon (:) = TO
[1:4]
1234 [1:0.5:4] Gives a vector from 1 to 4 with step 0.5 1 1.5 2 2.5 3 3.5 4 [0:0.1:2*pi] Gives a vector containing 0 to 2
Operators
Matrix Operators Y=A^2 Y=A^B
X=A*B
Functions Subscripting
Concatenation of Matrices
Suppose A, B, C are matrices
If we write [A B] or [A,B] If we write [A;B]
uGP