SlideShare a Scribd company logo
Introduction to MATLAB
Prepared by M.Starwin
What is MATLAB
• High level language for technical
computing
• Stands for MATrix LABoratory
• Everything is a matrix - easy to do
mathematical computations.
MATLAB
• Development Environment
• Mathematical Function Library
• Supports many toolboxes. Ex. Image
Processing, Signal Processing, Control
System etc…
Windows
• Command Window
• Edit Window
• Graphics Window
MATLAB Desktop
Menu and toolbar
Command
History
Workspace
Matrices & Vectors
• All (almost) entities in MATLAB are
matrices
• Easy to define:
• Use ‘,’ or ‘ ’ to separate row elements -- use
‘;’ to separate rows
>> A = [16 3; 5 10]
A = 16 3
5 10
Creating Vectors and Matrices
• Define
• Transpose
Vector :
>> a=[1 2 3];
>> a'
1
2
3
Matrix:
>> A=[1 2; 3 4];
>> A'
ans =
1 3
2 4
>> A = [16 3; 5 10]
A = 16 3
5 10
Creating Matrices
• zeros(m, n): matrix with all zeros
• ones(m, n): matrix with all ones.
• eye(m, n): the identity matrix
• magic(m): square matrix whose elements
have the same sum, along the row, column
and diagonal.
• pascal(m) : Pascal matrix.
Matrix operations
• ^: exponentiation
• *: multiplication
• /: division
• +: addition
• -: subtraction
Array Operations
• Evaluated element by element
.' : array transpose (non-conjugated
transpose)
.^ : array power
.* : array multiplication
./ : array division
• Very different from Matrix operations
>> A=[1 2;3 4];
>> B=[5 6;7 8];
>> A*B
19 22
43 50
But:
>> A.*B
5 12
21 32
Some Built-in functions
• mean(A):mean value of a vector
• max(A), min (A): maximum and minimum.
• sum(A): summation.
• sort(A): sorted vector
• median(A): median value
• std(A): standard deviation.
• det(A) : determinant of a square matrix
• dot(a,b): dot product of two vectors
• Cross(a,b): cross product of two vectors
• Inv(A): Inverse of a matrix A
Graphics - 2D Plots
plot(xdata, ydata, ‘marker_style’);
For example: Gives:
>> x=-5:0.1:5;
>> sqr=x.^2;
>> pl1=plot(x, sqr, 'r:s');
Graphics - Annotation
Use title, xlabel, and ylabel
>> title('Demo plot');
>> xlabel('X Axis');
>> ylabel('Y Axis');
Graphics - Annotation
Graphics-Stem()
• stem()is to plot discrete sequence data
• The usage of stem() is very similar to
plot()
>> n=-10:10;
>> f=stem(n,cos(n*pi/4))
>> title('cos(npi/4)')
>> xlabel('n')
-10 -5 0 5 10
-1
-0.5
0
0.5
1
cos(n/4)
n
subplots
• Use subplots to divide a plotting window
into several panes.
>> x=0:0.1:10;
>> f=figure;
>> f1=subplot(1,2,1);
>> plot(x,cos(x),'r');
>> grid on;
>> title('Cosine')
>> f2=subplot(1,2,2);
>> plot(x,sin(x),'d');
>> grid on;
>> title('Sine');
0 5 10
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Cosine
0 5 10
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Sine
Some Commands
• The keyword clear removes all variables
from workspace
• The keyword close removes the current
plots

More Related Content

What's hot

Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
VidhyaSenthil
 
Matlab matrices and arrays
Matlab matrices and arraysMatlab matrices and arrays
Matlab matrices and arrays
Ameen San
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
Satish Gummadi
 
Matlab graphics
Matlab graphicsMatlab graphics
Matlab graphics
pramodkumar1804
 
Matlab Presentation
Matlab PresentationMatlab Presentation
Matlab Presentation
Mohamed El Rayany
 
Volodymyr Lyubinets “Generative models for images”
Volodymyr Lyubinets  “Generative models for images”Volodymyr Lyubinets  “Generative models for images”
Volodymyr Lyubinets “Generative models for images”
Lviv Startup Club
 
Alg 2 sections 2.1
Alg 2 sections 2.1Alg 2 sections 2.1
Alg 2 sections 2.1nscross40
 
Matlab practical and lab session
Matlab practical and lab sessionMatlab practical and lab session
Matlab practical and lab sessionDr. Krishna Mohbey
 
Matlab HTI summer training course Lecture3
Matlab HTI summer training course Lecture3Matlab HTI summer training course Lecture3
Matlab HTI summer training course Lecture3
Mohamed Awni
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
Ravikiran A
 
Basic concepts in_matlab
Basic concepts in_matlabBasic concepts in_matlab
Basic concepts in_matlab
Mohammad Alauddin
 
Two Days workshop on MATLAB
Two Days workshop on MATLABTwo Days workshop on MATLAB
Two Days workshop on MATLABBhavesh Shah
 
Graph Plots in Matlab
Graph Plots in MatlabGraph Plots in Matlab
Graph Plots in Matlab
DataminingTools Inc
 
Matlab Introduction
Matlab IntroductionMatlab Introduction
Matlab Introduction
Daniel Moore
 
Aaa ped-4- Data manipulation: Numpy
Aaa ped-4- Data manipulation: Numpy Aaa ped-4- Data manipulation: Numpy
Aaa ped-4- Data manipulation: Numpy
AminaRepo
 
B61301007 matlab documentation
B61301007 matlab documentationB61301007 matlab documentation
B61301007 matlab documentation
Manchireddy Reddy
 
Mat lab workshop
Mat lab workshopMat lab workshop
Mat lab workshop
Vinay Kumar
 

What's hot (19)

Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Matlab matrices and arrays
Matlab matrices and arraysMatlab matrices and arrays
Matlab matrices and arrays
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Matlab graphics
Matlab graphicsMatlab graphics
Matlab graphics
 
Matlab Presentation
Matlab PresentationMatlab Presentation
Matlab Presentation
 
Volodymyr Lyubinets “Generative models for images”
Volodymyr Lyubinets  “Generative models for images”Volodymyr Lyubinets  “Generative models for images”
Volodymyr Lyubinets “Generative models for images”
 
Alg 2 sections 2.1
Alg 2 sections 2.1Alg 2 sections 2.1
Alg 2 sections 2.1
 
Matlab practical and lab session
Matlab practical and lab sessionMatlab practical and lab session
Matlab practical and lab session
 
Matlab HTI summer training course Lecture3
Matlab HTI summer training course Lecture3Matlab HTI summer training course Lecture3
Matlab HTI summer training course Lecture3
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
Intro matlab
Intro matlabIntro matlab
Intro matlab
 
Basic concepts in_matlab
Basic concepts in_matlabBasic concepts in_matlab
Basic concepts in_matlab
 
Two Days workshop on MATLAB
Two Days workshop on MATLABTwo Days workshop on MATLAB
Two Days workshop on MATLAB
 
Graph Plots in Matlab
Graph Plots in MatlabGraph Plots in Matlab
Graph Plots in Matlab
 
Matlab Introduction
Matlab IntroductionMatlab Introduction
Matlab Introduction
 
Aaa ped-4- Data manipulation: Numpy
Aaa ped-4- Data manipulation: Numpy Aaa ped-4- Data manipulation: Numpy
Aaa ped-4- Data manipulation: Numpy
 
B61301007 matlab documentation
B61301007 matlab documentationB61301007 matlab documentation
B61301007 matlab documentation
 
ADVANCED WORKSHOP IN MATLAB
ADVANCED WORKSHOP IN MATLABADVANCED WORKSHOP IN MATLAB
ADVANCED WORKSHOP IN MATLAB
 
Mat lab workshop
Mat lab workshopMat lab workshop
Mat lab workshop
 

Similar to Matlab introduction

An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginners
Murshida ck
 
Introduction to Matlab.ppt
Introduction to Matlab.pptIntroduction to Matlab.ppt
Introduction to Matlab.ppt
Ravibabu Kancharla
 
Matlab-1.pptx
Matlab-1.pptxMatlab-1.pptx
Matlab-1.pptx
aboma2hawi
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
joellivz
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
Vikash Jakhar
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabSantosh V
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
Khulna University
 
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
anaveenkumar4
 
Matlab Tutorial.ppt
Matlab Tutorial.pptMatlab Tutorial.ppt
Matlab Tutorial.ppt
RaviMuthamala1
 
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
Karthik537368
 
Matlab ppt
Matlab pptMatlab ppt
Matlab ppt
chestialtaff
 
Matlab_Harshal.pptx
Matlab_Harshal.pptxMatlab_Harshal.pptx
Matlab_Harshal.pptx
HarshalGosavi8
 
1.1Introduction to matlab.pptx
1.1Introduction to matlab.pptx1.1Introduction to matlab.pptx
1.1Introduction to matlab.pptx
BeheraA
 
Matlab
MatlabMatlab
MATLAB_CIS601-03.ppt
MATLAB_CIS601-03.pptMATLAB_CIS601-03.ppt
MATLAB_CIS601-03.ppt
aboma2hawi
 
Mat lab
Mat labMat lab
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
Dnyanesh Patil
 
MATLAB for Technical Computing
MATLAB for Technical ComputingMATLAB for Technical Computing
MATLAB for Technical Computing
Naveed Rehman
 
MATLAB Programming
MATLAB Programming MATLAB Programming
MATLAB Programming
محمدعبد الحى
 

Similar to Matlab introduction (20)

An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginners
 
Introduction to Matlab.ppt
Introduction to Matlab.pptIntroduction to Matlab.ppt
Introduction to Matlab.ppt
 
Matlab-1.pptx
Matlab-1.pptxMatlab-1.pptx
Matlab-1.pptx
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
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 Tutorial.ppt
Matlab Tutorial.pptMatlab Tutorial.ppt
Matlab Tutorial.ppt
 
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
 
Matlab ppt
Matlab pptMatlab ppt
Matlab ppt
 
Matlab_Harshal.pptx
Matlab_Harshal.pptxMatlab_Harshal.pptx
Matlab_Harshal.pptx
 
1.1Introduction to matlab.pptx
1.1Introduction to matlab.pptx1.1Introduction to matlab.pptx
1.1Introduction to matlab.pptx
 
Matlab
MatlabMatlab
Matlab
 
MATLAB_CIS601-03.ppt
MATLAB_CIS601-03.pptMATLAB_CIS601-03.ppt
MATLAB_CIS601-03.ppt
 
Mat lab
Mat labMat lab
Mat lab
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
MATLAB for Technical Computing
MATLAB for Technical ComputingMATLAB for Technical Computing
MATLAB for Technical Computing
 
MATLAB Programming
MATLAB Programming MATLAB Programming
MATLAB Programming
 
MATLAB & Image Processing
MATLAB & Image ProcessingMATLAB & Image Processing
MATLAB & Image Processing
 

More from ssuser2797e4

Optical power measurement
Optical power measurementOptical power measurement
Optical power measurement
ssuser2797e4
 
EC8553 Discrete time signal processing
EC8553 Discrete time signal processing EC8553 Discrete time signal processing
EC8553 Discrete time signal processing
ssuser2797e4
 
EC8562 DSP Viva Questions
EC8562 DSP Viva Questions EC8562 DSP Viva Questions
EC8562 DSP Viva Questions
ssuser2797e4
 
IIR filter
IIR filterIIR filter
IIR filter
ssuser2797e4
 
Transforms
TransformsTransforms
Transforms
ssuser2797e4
 
Man made disasters
Man made disastersMan made disasters
Man made disasters
ssuser2797e4
 
Coastal flooding
Coastal floodingCoastal flooding
Coastal flooding
ssuser2797e4
 
DFT and its properties
DFT and its propertiesDFT and its properties
DFT and its properties
ssuser2797e4
 

More from ssuser2797e4 (8)

Optical power measurement
Optical power measurementOptical power measurement
Optical power measurement
 
EC8553 Discrete time signal processing
EC8553 Discrete time signal processing EC8553 Discrete time signal processing
EC8553 Discrete time signal processing
 
EC8562 DSP Viva Questions
EC8562 DSP Viva Questions EC8562 DSP Viva Questions
EC8562 DSP Viva Questions
 
IIR filter
IIR filterIIR filter
IIR filter
 
Transforms
TransformsTransforms
Transforms
 
Man made disasters
Man made disastersMan made disasters
Man made disasters
 
Coastal flooding
Coastal floodingCoastal flooding
Coastal flooding
 
DFT and its properties
DFT and its propertiesDFT and its properties
DFT and its properties
 

Recently uploaded

Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
ShahidSultan24
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 

Recently uploaded (20)

Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 

Matlab introduction

  • 2. What is MATLAB • High level language for technical computing • Stands for MATrix LABoratory • Everything is a matrix - easy to do mathematical computations.
  • 3. MATLAB • Development Environment • Mathematical Function Library • Supports many toolboxes. Ex. Image Processing, Signal Processing, Control System etc…
  • 4. Windows • Command Window • Edit Window • Graphics Window
  • 5. MATLAB Desktop Menu and toolbar Command History Workspace
  • 6. Matrices & Vectors • All (almost) entities in MATLAB are matrices • Easy to define: • Use ‘,’ or ‘ ’ to separate row elements -- use ‘;’ to separate rows >> A = [16 3; 5 10] A = 16 3 5 10
  • 7. Creating Vectors and Matrices • Define • Transpose Vector : >> a=[1 2 3]; >> a' 1 2 3 Matrix: >> A=[1 2; 3 4]; >> A' ans = 1 3 2 4 >> A = [16 3; 5 10] A = 16 3 5 10
  • 8. Creating Matrices • zeros(m, n): matrix with all zeros • ones(m, n): matrix with all ones. • eye(m, n): the identity matrix • magic(m): square matrix whose elements have the same sum, along the row, column and diagonal. • pascal(m) : Pascal matrix.
  • 9. Matrix operations • ^: exponentiation • *: multiplication • /: division • +: addition • -: subtraction
  • 10. Array Operations • Evaluated element by element .' : array transpose (non-conjugated transpose) .^ : array power .* : array multiplication ./ : array division • Very different from Matrix operations >> A=[1 2;3 4]; >> B=[5 6;7 8]; >> A*B 19 22 43 50 But: >> A.*B 5 12 21 32
  • 11. Some Built-in functions • mean(A):mean value of a vector • max(A), min (A): maximum and minimum. • sum(A): summation. • sort(A): sorted vector • median(A): median value • std(A): standard deviation. • det(A) : determinant of a square matrix • dot(a,b): dot product of two vectors • Cross(a,b): cross product of two vectors • Inv(A): Inverse of a matrix A
  • 12. Graphics - 2D Plots plot(xdata, ydata, ‘marker_style’); For example: Gives: >> x=-5:0.1:5; >> sqr=x.^2; >> pl1=plot(x, sqr, 'r:s');
  • 13. Graphics - Annotation Use title, xlabel, and ylabel >> title('Demo plot'); >> xlabel('X Axis'); >> ylabel('Y Axis');
  • 15. Graphics-Stem() • stem()is to plot discrete sequence data • The usage of stem() is very similar to plot() >> n=-10:10; >> f=stem(n,cos(n*pi/4)) >> title('cos(npi/4)') >> xlabel('n') -10 -5 0 5 10 -1 -0.5 0 0.5 1 cos(n/4) n
  • 16. subplots • Use subplots to divide a plotting window into several panes. >> x=0:0.1:10; >> f=figure; >> f1=subplot(1,2,1); >> plot(x,cos(x),'r'); >> grid on; >> title('Cosine') >> f2=subplot(1,2,2); >> plot(x,sin(x),'d'); >> grid on; >> title('Sine'); 0 5 10 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Cosine 0 5 10 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Sine
  • 17. Some Commands • The keyword clear removes all variables from workspace • The keyword close removes the current plots