SlideShare a Scribd company logo
Department of Electrical Engineering
HCET
Aditi Tiwari
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:
 Type C to see the value
C=9
>>A=5;
>>B=4;
>>C=A+B;
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
 Types:
 Script File
 Set of code lines
 Function File
 A code implementing some functions like sin, cos exp (they
are inbuilt)
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:
These are some of the
Polynomials you have
Come across.
Polynomials in MATLAB
 A polynomial can be represented in the form of
coefficients. For example, if you want to write
 You have to just write [1 2 2 5]
 Each number represents the value of coefficients.
 This will be represented as [1 0 2 5]
System Modeling using Matrix:
 Recall the well known example of LCR circuit:
 Output across resistor V0=R.i
 Modeled using matrix as
I
N
P
U
T
O
U
T
P
U
T
Similarly a Motor System
 A Motor Speed System
 We write its state equations:
Transfer Functions
 Polynomials
 [K2]
 [1 2 K2]
Neural Systems
 Systems modeled as a set of transformation with
neurons as Weight matrixes
matlab
Problems with Other Programming
Languages
 No Matrix operations
 For Loops everywhere
 Lots of unnecessary lines
matlab
matlab
with MALTAB
Define Matrixs
 Mix , and ; to make 2 D matrix
A=[1 2 3 2; 1 3 2 1;2 3 6 1]
 Make A 1 to 10 Matrix
A=[1 2 3 4 5 6 7 8 9 10];
 Make 1 to 100
 Tired??
 Use colon :Which mean “TO”
A=[1:100];
Colon (:) = TO
[1:4]
 Gives a vector from 1 to 4
1 2 3 4
[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
 Dot Operators
 Y=A.^2
 X=A.*B
 Y=A.^B
Functions
Subscripting
Typical MATLAB functions
 Mathematical
 sqrt
 sin,cos,tan
 Log, exp
 Creation
 ones
 zeros
 eye
 Rand
 Information
 size
 length
Typical MATLAB functions
 Matrix Operations
 sum
 diag
 transpose or ‘
 inv
 det
 eig
 fliplr
 reshape
 flipud
 rot90
 repmat
Concatenation of Matrices
 Suppose A, B, C are matrices
 If we write [A B] or [A,B]
 If we write [A;B]
 Similarly [A B C] and [A;B;C]
 [[A B];C]
 Crete a with size 4x5
 With elements from 3to7
 uGP
Arn-1
N=[1:20]
Y=2*(1/2).^(N-1)

More Related Content

PDF
working with matrices in r
PDF
MATLAB Basics-Part1
PDF
Matlab HTI summer training course_Lecture2
PPTX
Introduction to MATLAB
PDF
Introduction to MATLAB 1
PPTX
Matlab HTI summer training course Lecture3
PPTX
Basic operators in matlab
PDF
Matlab-Data types and operators
working with matrices in r
MATLAB Basics-Part1
Matlab HTI summer training course_Lecture2
Introduction to MATLAB
Introduction to MATLAB 1
Matlab HTI summer training course Lecture3
Basic operators in matlab
Matlab-Data types and operators

What's hot (20)

PDF
Introduction to simulink (1)
PDF
Matlab for beginners, Introduction, signal processing
PPTX
Matlab project
PDF
Parallel Algorithms
PDF
Matlab programming project
PPTX
An Introduction to MATLAB for beginners
PPTX
Matlab for diploma students(1)
PPT
Basics of programming in matlab
PDF
Forelasning4
PPTX
Matlab introduction
PPTX
Introduction to programming in MATLAB
PDF
Matlab Tutorial for Beginners - I
PPT
MATLAB/SIMULINK for engineering applications: day 3
PPT
Matlab Basic Tutorial
PPT
Introduction to matlab
PPTX
Parallel sorting algorithm
DOCX
Parallel searching
PPTX
SFG and Mason's Gain Formula
PPTX
Signal Flow Graph Introduction
PDF
Matlab lecture 1 - installation of matlab, introduction and course outline@taj
Introduction to simulink (1)
Matlab for beginners, Introduction, signal processing
Matlab project
Parallel Algorithms
Matlab programming project
An Introduction to MATLAB for beginners
Matlab for diploma students(1)
Basics of programming in matlab
Forelasning4
Matlab introduction
Introduction to programming in MATLAB
Matlab Tutorial for Beginners - I
MATLAB/SIMULINK for engineering applications: day 3
Matlab Basic Tutorial
Introduction to matlab
Parallel sorting algorithm
Parallel searching
SFG and Mason's Gain Formula
Signal Flow Graph Introduction
Matlab lecture 1 - installation of matlab, introduction and course outline@taj
Ad

Viewers also liked (20)

PPTX
MAJOE PROJECT PPT
PDF
CO2 As A Future Refrigerant - An Aranca Report
PPT
Future Refrigerant Options with Low Climate Impact for Stationary Air Conditi...
PPTX
Refrigerant environment and legislative update the future of refrigerants c...
PDF
Thesis on harmonic distortion ps
PPTX
Ps harmonics
PPT
Vivek harmonics
PDF
Harmonics: Causes and Effects
PPTX
harmonic distortion ppt
PDF
REDUCTION OF HARMONIC DISTORTION IN BLDC DRIVE USING BL-BUCK BOOST CONVERTER ...
PPS
Harmonics in power system
PPT
Scada classification
PDF
Smart City and Smart Government : Strategy, Model, and Cases of Korea
PPTX
All about scada
PPT
Slidehare
PPTX
Smart city
PPTX
Scada Industrial Control Systems Penetration Testing
PPTX
India smart city opportunity
PPTX
Scada and power system automation
PDF
PLC SCADA
MAJOE PROJECT PPT
CO2 As A Future Refrigerant - An Aranca Report
Future Refrigerant Options with Low Climate Impact for Stationary Air Conditi...
Refrigerant environment and legislative update the future of refrigerants c...
Thesis on harmonic distortion ps
Ps harmonics
Vivek harmonics
Harmonics: Causes and Effects
harmonic distortion ppt
REDUCTION OF HARMONIC DISTORTION IN BLDC DRIVE USING BL-BUCK BOOST CONVERTER ...
Harmonics in power system
Scada classification
Smart City and Smart Government : Strategy, Model, and Cases of Korea
All about scada
Slidehare
Smart city
Scada Industrial Control Systems Penetration Testing
India smart city opportunity
Scada and power system automation
PLC SCADA
Ad

Similar to matlab (20)

PPT
Matlab introduction
PDF
Introduction to MATLAB
PPT
4413-lecture-09 Introduction Matlab lecture .ppt
PPT
gmrit-cse
PPTX
Mat lab workshop
PDF
Modellbildung, Berechnung und Simulation in Forschung und Lehre
PPT
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
PPT
MATLAB_CIS601-03.ppt
PPTX
1.1Introduction to matlab.pptx
PDF
Summer training matlab
PPT
473431331-Matlab-Simulink-Tutorial-ppt.ppt
PPTX
Summer training matlab
PDF
EE6711 Power System Simulation Lab manual
PPT
INTRODUCTION TO MATLAB for PG students.ppt
PPSX
Matlab basic and image
PPTX
presentation.pptx
PDF
Smib pgm
PDF
MATLAB Programming
PDF
Control system Lab record
PDF
Matlab introduction
Introduction to MATLAB
4413-lecture-09 Introduction Matlab lecture .ppt
gmrit-cse
Mat lab workshop
Modellbildung, Berechnung und Simulation in Forschung und Lehre
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB_CIS601-03.ppt
1.1Introduction to matlab.pptx
Summer training matlab
473431331-Matlab-Simulink-Tutorial-ppt.ppt
Summer training matlab
EE6711 Power System Simulation Lab manual
INTRODUCTION TO MATLAB for PG students.ppt
Matlab basic and image
presentation.pptx
Smib pgm
MATLAB Programming
Control system Lab record

matlab

  • 1. Department of Electrical Engineering HCET Aditi Tiwari
  • 3. 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
  • 5. A Simple Start:  Add two Variables  No definitions needed, no classes needed  On command window type:  Type C to see the value C=9 >>A=5; >>B=4; >>C=A+B;
  • 6. 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  Types:  Script File  Set of code lines  Function File  A code implementing some functions like sin, cos exp (they are inbuilt)
  • 7. 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]
  • 8. 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
  • 9. Polynomials: These are some of the Polynomials you have Come across.
  • 10. Polynomials in MATLAB  A polynomial can be represented in the form of coefficients. For example, if you want to write  You have to just write [1 2 2 5]  Each number represents the value of coefficients.  This will be represented as [1 0 2 5]
  • 11. System Modeling using Matrix:  Recall the well known example of LCR circuit:  Output across resistor V0=R.i  Modeled using matrix as I N P U T O U T P U T
  • 12. Similarly a Motor System  A Motor Speed System  We write its state equations:
  • 14. Neural Systems  Systems modeled as a set of transformation with neurons as Weight matrixes
  • 16. Problems with Other Programming Languages  No Matrix operations  For Loops everywhere  Lots of unnecessary lines
  • 20. Define Matrixs  Mix , and ; to make 2 D matrix A=[1 2 3 2; 1 3 2 1;2 3 6 1]  Make A 1 to 10 Matrix A=[1 2 3 4 5 6 7 8 9 10];  Make 1 to 100  Tired??  Use colon :Which mean “TO” A=[1:100];
  • 21. Colon (:) = TO [1:4]  Gives a vector from 1 to 4 1 2 3 4 [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π
  • 22. Operators  Matrix Operators  Y=A^2  Y=A^B  X=A*B  Dot Operators  Y=A.^2  X=A.*B  Y=A.^B
  • 24. Typical MATLAB functions  Mathematical  sqrt  sin,cos,tan  Log, exp  Creation  ones  zeros  eye  Rand  Information  size  length
  • 25. Typical MATLAB functions  Matrix Operations  sum  diag  transpose or ‘  inv  det  eig  fliplr  reshape  flipud  rot90  repmat
  • 26. Concatenation of Matrices  Suppose A, B, C are matrices  If we write [A B] or [A,B]  If we write [A;B]  Similarly [A B C] and [A;B;C]  [[A B];C]
  • 27.  Crete a with size 4x5  With elements from 3to7  uGP Arn-1 N=[1:20] Y=2*(1/2).^(N-1)