SlideShare a Scribd company logo
1 of 27
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
Problems with Other Programming
Languages
 No Matrix operations
 For Loops everywhere
 Lots of unnecessary lines
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

What's hot

Introduction to simulink (1)
Introduction to simulink (1)Introduction to simulink (1)
Introduction to simulink (1)Memo Love
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingDr. Manjunatha. P
 
Matlab programming project
Matlab programming projectMatlab programming project
Matlab programming projectAssignmentpedia
 
An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersMurshida ck
 
Matlab for diploma students(1)
Matlab for diploma students(1)Matlab for diploma students(1)
Matlab for diploma students(1)Retheesh Raj
 
Basics of programming in matlab
Basics of programming in matlabBasics of programming in matlab
Basics of programming in matlabAKANKSHA GUPTA
 
Forelasning4
Forelasning4Forelasning4
Forelasning4Memo Love
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introductionAmeen San
 
Introduction to programming in MATLAB
Introduction to programming in MATLABIntroduction to programming in MATLAB
Introduction to programming in MATLABmustafa_92
 
Matlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IMatlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IVijay Kumar Gupta
 
MATLAB/SIMULINK for engineering applications: day 3
MATLAB/SIMULINK for engineering applications: day 3MATLAB/SIMULINK for engineering applications: day 3
MATLAB/SIMULINK for engineering applications: day 3reddyprasad reddyvari
 
Parallel sorting algorithm
Parallel sorting algorithmParallel sorting algorithm
Parallel sorting algorithmRicha Kumari
 
SFG and Mason's Gain Formula
SFG and Mason's Gain FormulaSFG and Mason's Gain Formula
SFG and Mason's Gain Formulapriyankabirlaa
 
Signal Flow Graph Introduction
Signal Flow Graph IntroductionSignal Flow Graph Introduction
Signal Flow Graph Introductionpriyankabirlaa
 
Matlab lecture 1 - installation of matlab, introduction and course outline@taj
Matlab lecture 1 - installation of matlab, introduction and course outline@tajMatlab lecture 1 - installation of matlab, introduction and course outline@taj
Matlab lecture 1 - installation of matlab, introduction and course outline@tajTajim Md. Niamat Ullah Akhund
 

What's hot (20)

Introduction to simulink (1)
Introduction to simulink (1)Introduction to simulink (1)
Introduction to simulink (1)
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processing
 
Matlab project
Matlab projectMatlab project
Matlab project
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
Matlab programming project
Matlab programming projectMatlab programming project
Matlab programming project
 
An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginners
 
Matlab for diploma students(1)
Matlab for diploma students(1)Matlab for diploma students(1)
Matlab for diploma students(1)
 
Basics of programming in matlab
Basics of programming in matlabBasics of programming in matlab
Basics of programming in matlab
 
Forelasning4
Forelasning4Forelasning4
Forelasning4
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Introduction to programming in MATLAB
Introduction to programming in MATLABIntroduction to programming in MATLAB
Introduction to programming in MATLAB
 
Matlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IMatlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - I
 
MATLAB/SIMULINK for engineering applications: day 3
MATLAB/SIMULINK for engineering applications: day 3MATLAB/SIMULINK for engineering applications: day 3
MATLAB/SIMULINK for engineering applications: day 3
 
Matlab Basic Tutorial
Matlab Basic TutorialMatlab Basic Tutorial
Matlab Basic Tutorial
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Parallel sorting algorithm
Parallel sorting algorithmParallel sorting algorithm
Parallel sorting algorithm
 
Parallel searching
Parallel searchingParallel searching
Parallel searching
 
SFG and Mason's Gain Formula
SFG and Mason's Gain FormulaSFG and Mason's Gain Formula
SFG and Mason's Gain Formula
 
Signal Flow Graph Introduction
Signal Flow Graph IntroductionSignal Flow Graph Introduction
Signal Flow Graph Introduction
 
Matlab lecture 1 - installation of matlab, introduction and course outline@taj
Matlab lecture 1 - installation of matlab, introduction and course outline@tajMatlab lecture 1 - installation of matlab, introduction and course outline@taj
Matlab lecture 1 - installation of matlab, introduction and course outline@taj
 

Viewers also liked

CO2 As A Future Refrigerant - An Aranca Report
CO2 As A Future Refrigerant - An Aranca ReportCO2 As A Future Refrigerant - An Aranca Report
CO2 As A Future Refrigerant - An Aranca ReportAranca
 
Future Refrigerant Options with Low Climate Impact for Stationary Air Conditi...
Future Refrigerant Options with Low Climate Impact for Stationary Air Conditi...Future Refrigerant Options with Low Climate Impact for Stationary Air Conditi...
Future Refrigerant Options with Low Climate Impact for Stationary Air Conditi...UNEP OzonAction
 
Refrigerant environment and legislative update the future of refrigerants c...
Refrigerant environment and legislative update   the future of refrigerants c...Refrigerant environment and legislative update   the future of refrigerants c...
Refrigerant environment and legislative update the future of refrigerants c...omairfarooq
 
Thesis on harmonic distortion ps
Thesis on harmonic distortion psThesis on harmonic distortion ps
Thesis on harmonic distortion pskavithasasidharan
 
Harmonics: Causes and Effects
Harmonics: Causes and EffectsHarmonics: Causes and Effects
Harmonics: Causes and EffectsLeonardo ENERGY
 
harmonic distortion ppt
harmonic distortion pptharmonic distortion ppt
harmonic distortion pptAditi Tiwari
 
REDUCTION OF HARMONIC DISTORTION IN BLDC DRIVE USING BL-BUCK BOOST CONVERTER ...
REDUCTION OF HARMONIC DISTORTION IN BLDC DRIVE USING BL-BUCK BOOST CONVERTER ...REDUCTION OF HARMONIC DISTORTION IN BLDC DRIVE USING BL-BUCK BOOST CONVERTER ...
REDUCTION OF HARMONIC DISTORTION IN BLDC DRIVE USING BL-BUCK BOOST CONVERTER ...IAEME Publication
 
Harmonics in power system
Harmonics in power systemHarmonics in power system
Harmonics in power systemMinh Anh Nguyen
 
Scada classification
Scada classificationScada classification
Scada classificationAhmed Sebaii
 
Smart City and Smart Government : Strategy, Model, and Cases of Korea
Smart City and Smart Government : Strategy, Model, and Cases of KoreaSmart City and Smart Government : Strategy, Model, and Cases of Korea
Smart City and Smart Government : Strategy, Model, and Cases of KoreaJong-Sung Hwang
 
Scada Industrial Control Systems Penetration Testing
Scada Industrial Control Systems Penetration Testing Scada Industrial Control Systems Penetration Testing
Scada Industrial Control Systems Penetration Testing Yehia Mamdouh
 
India smart city opportunity
India smart city opportunityIndia smart city opportunity
India smart city opportunityZinnov
 
Scada and power system automation
Scada and power system automationScada and power system automation
Scada and power system automationShubham Kapoor
 

Viewers also liked (20)

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

Similar to matlab

INTRODUCTION TO MATLAB for PG students.ppt
INTRODUCTION TO MATLAB for PG students.pptINTRODUCTION TO MATLAB for PG students.ppt
INTRODUCTION TO MATLAB for PG students.pptKarthik537368
 
Raushan's MATLB PPT..pptx
Raushan's MATLB PPT..pptxRaushan's MATLB PPT..pptx
Raushan's MATLB PPT..pptxhmghj
 
MATLAB_CIS601-03.ppt
MATLAB_CIS601-03.pptMATLAB_CIS601-03.ppt
MATLAB_CIS601-03.pptaboma2hawi
 
Matrix operations in MATLAB
Matrix operations in MATLABMatrix operations in MATLAB
Matrix operations in MATLABSaloni Singhal
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabDnyanesh Patil
 
Summer training matlab
Summer training matlab Summer training matlab
Summer training matlab Arshit Rai
 
From zero to MATLAB hero: Mastering the basics and beyond
From zero to MATLAB hero: Mastering the basics and beyondFrom zero to MATLAB hero: Mastering the basics and beyond
From zero to MATLAB hero: Mastering the basics and beyondMahuaPal6
 
TRAINING PROGRAMME ON MATLAB ASSOCIATE EXAM (1).pptx
TRAINING PROGRAMME ON MATLAB  ASSOCIATE EXAM (1).pptxTRAINING PROGRAMME ON MATLAB  ASSOCIATE EXAM (1).pptx
TRAINING PROGRAMME ON MATLAB ASSOCIATE EXAM (1).pptxanaveenkumar4
 
Summer training matlab
Summer training matlab Summer training matlab
Summer training matlab Arshit Rai
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functionsjoellivz
 
Signals And Systems Lab Manual, R18 Batch
Signals And Systems Lab Manual, R18 BatchSignals And Systems Lab Manual, R18 Batch
Signals And Systems Lab Manual, R18 BatchAmairullah Khan Lodhi
 

Similar to matlab (20)

Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
INTRODUCTION TO MATLAB for PG students.ppt
INTRODUCTION TO MATLAB for PG students.pptINTRODUCTION TO MATLAB for PG students.ppt
INTRODUCTION TO MATLAB for PG students.ppt
 
Raushan's MATLB PPT..pptx
Raushan's MATLB PPT..pptxRaushan's MATLB PPT..pptx
Raushan's MATLB PPT..pptx
 
MATLAB INTRODUCTION
MATLAB INTRODUCTIONMATLAB INTRODUCTION
MATLAB INTRODUCTION
 
MATLAB_CIS601-03.ppt
MATLAB_CIS601-03.pptMATLAB_CIS601-03.ppt
MATLAB_CIS601-03.ppt
 
Matrix operations in MATLAB
Matrix operations in MATLABMatrix operations in MATLAB
Matrix operations in MATLAB
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
sol43.pdf
sol43.pdfsol43.pdf
sol43.pdf
 
Matlab Tutorial.ppt
Matlab Tutorial.pptMatlab Tutorial.ppt
Matlab Tutorial.ppt
 
Introduction to Matlab.ppt
Introduction to Matlab.pptIntroduction to Matlab.ppt
Introduction to Matlab.ppt
 
Summer training matlab
Summer training matlab Summer training matlab
Summer training matlab
 
From zero to MATLAB hero: Mastering the basics and beyond
From zero to MATLAB hero: Mastering the basics and beyondFrom zero to MATLAB hero: Mastering the basics and beyond
From zero to MATLAB hero: Mastering the basics and beyond
 
TRAINING PROGRAMME ON MATLAB ASSOCIATE EXAM (1).pptx
TRAINING PROGRAMME ON MATLAB  ASSOCIATE EXAM (1).pptxTRAINING PROGRAMME ON MATLAB  ASSOCIATE EXAM (1).pptx
TRAINING PROGRAMME ON MATLAB ASSOCIATE EXAM (1).pptx
 
Matlab
MatlabMatlab
Matlab
 
Summer training matlab
Summer training matlab Summer training matlab
Summer training matlab
 
Matlab ppt
Matlab pptMatlab ppt
Matlab ppt
 
Lecture one
Lecture oneLecture one
Lecture one
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
 
Signals And Systems Lab Manual, R18 Batch
Signals And Systems Lab Manual, R18 BatchSignals And Systems Lab Manual, R18 Batch
Signals And Systems Lab Manual, R18 Batch
 

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
  • 15.
  • 16. Problems with Other Programming Languages  No Matrix operations  For Loops everywhere  Lots of unnecessary lines
  • 17.
  • 18.
  • 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)