SlideShare a Scribd company logo
MATLAB NOTES
1
MATLAB NOTES
BY
AHMED Y. NASSAR
Surveying Department
Faculty of Engineering, Shoubra
Benha University
MATLAB NOTES
2
To create a matrix that has multiple rows, separate the rows with
semicolons.
>> a = [1 2 3; 4 5 6; 7 8 10]
a =
1 2 3
4 5 6
7 8 10
Another way to create a matrix is to use a function, such as ones, zeros,
or rand. For example, create a 5-by-1 column vector of zeros.
>> z = zeros(5,1)
z =
0
0
0
0
0
>> z = ones(5,2)
MATLAB NOTES
3
z =
1 1
1 1
1 1
1 1
1 1
>> z = rand(5,3)
z =
0.8147 0.0975 0.1576
0.9058 0.2785 0.9706
0.1270 0.5469 0.9572
0.9134 0.9575 0.4854
0.6324 0.9649 0.8003
To transpose a matrix, use a single quote ('):
>> a'
ans =
1 4 7
2 5 8
3 6 10
>> a + 10
MATLAB NOTES
4
ans =
11 12 13
14 15 16
17 18 20
To perform element-wise multiplication rather than matrix
multiplication, use the .* operator:
>> p = a.*a
p =
1 4 9
16 25 36
49 64 100
To perform Natural Matrix multiplication, use the * operator:
>> a * a
ans =
30 36 45
66 81 102
109 134 169
MATLAB NOTES
5
Concatenation
>> A = [a,a]
A =
1 2 3 1 2 3
4 5 6 4 5 6
7 8 10 7 8 10
>> A = [a; a]
A =
1 2 3
4 5 6
7 8 10
1 2 3
4 5 6
7 8 10
When you want to access selected elements of an array, use indexing.
>> a(2,2)
ans =
5
MATLAB NOTES
6
use a single subscript that traverses down each column in order:
>> a(6)
ans =
8
The colon operator also allows you to create an equally spaced vector
of values using the form start:step:end.
>> b = 0:20:200
b =
0 20 40 60 80 100 120 140 160 180 200
sqrt(X) is the square root of the elements of X. Complex results are
produced if X is not positive.
>> sqrt((-2:2)')
ans =
0.0000 + 1.4142i
0.0000 + 1.0000i
0.0000 + 0.0000i
1.0000 + 0.0000i
1.4142 + 0.0000i
Ad

More Related Content

Similar to Notes on MATLAB - Basic Cheatsheet (20)

Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
Satish Gummadi
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
Devaraj Chilakala
 
Mat lab
Mat labMat lab
Mat lab
Gizachew Kefelew
 
Matlab an Introduction_Lecture_for all.ppt
Matlab an Introduction_Lecture_for all.pptMatlab an Introduction_Lecture_for all.ppt
Matlab an Introduction_Lecture_for all.ppt
PoojaSharma693700
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
Dnyanesh Patil
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
Vikash Jakhar
 
Chapter 6 Matrices in MATLAB
Chapter 6 Matrices in MATLABChapter 6 Matrices in MATLAB
Chapter 6 Matrices in MATLAB
Pranoti Doke
 
Matlab
MatlabMatlab
Matlab
Kelin Jose
 
MATLAB - Arrays and Matrices
MATLAB - Arrays and MatricesMATLAB - Arrays and Matrices
MATLAB - Arrays and Matrices
Shameer Ahmed Koya
 
MATLAB ARRAYS
MATLAB ARRAYSMATLAB ARRAYS
MATLAB ARRAYS
Aditya Choudhury
 
20100528
2010052820100528
20100528
byron zhao
 
20100528
2010052820100528
20100528
byron zhao
 
Importance of matlab
Importance of matlabImportance of matlab
Importance of matlab
krajeshk1980
 
presentation.pptx
presentation.pptxpresentation.pptx
presentation.pptx
raghav415187
 
Matlab quick quide3.4
Matlab  quick quide3.4Matlab  quick quide3.4
Matlab quick quide3.4
Mohamd Fawzi Nabulsi
 
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
 
MATLAB-Introd.ppt
MATLAB-Introd.pptMATLAB-Introd.ppt
MATLAB-Introd.ppt
kebeAman
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
joellivz
 
Basics of Matlab for students and faculty
Basics of Matlab for students and facultyBasics of Matlab for students and faculty
Basics of Matlab for students and faculty
AbhishekRanjan17318
 
INTRODUCTION TO MATLAB session with notes
  INTRODUCTION TO MATLAB   session with  notes  INTRODUCTION TO MATLAB   session with  notes
INTRODUCTION TO MATLAB session with notes
Infinity Tech Solutions
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
Devaraj Chilakala
 
Matlab an Introduction_Lecture_for all.ppt
Matlab an Introduction_Lecture_for all.pptMatlab an Introduction_Lecture_for all.ppt
Matlab an Introduction_Lecture_for all.ppt
PoojaSharma693700
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
Dnyanesh Patil
 
Chapter 6 Matrices in MATLAB
Chapter 6 Matrices in MATLABChapter 6 Matrices in MATLAB
Chapter 6 Matrices in MATLAB
Pranoti Doke
 
Importance of matlab
Importance of matlabImportance of matlab
Importance of matlab
krajeshk1980
 
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
 
MATLAB-Introd.ppt
MATLAB-Introd.pptMATLAB-Introd.ppt
MATLAB-Introd.ppt
kebeAman
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
joellivz
 
Basics of Matlab for students and faculty
Basics of Matlab for students and facultyBasics of Matlab for students and faculty
Basics of Matlab for students and faculty
AbhishekRanjan17318
 
INTRODUCTION TO MATLAB session with notes
  INTRODUCTION TO MATLAB   session with  notes  INTRODUCTION TO MATLAB   session with  notes
INTRODUCTION TO MATLAB session with notes
Infinity Tech Solutions
 

More from Ahmed Nassar (20)

Hydrographic Surveying : Safe Navigation
Hydrographic Surveying : Safe Navigation Hydrographic Surveying : Safe Navigation
Hydrographic Surveying : Safe Navigation
Ahmed Nassar
 
DETERMINATION OF THE EARTH’S RADIUS, MASS, AND GRAVITIONAL CONSTANT - PHYSIC...
DETERMINATION OF THE EARTH’S RADIUS, MASS, AND GRAVITIONAL CONSTANT  - PHYSIC...DETERMINATION OF THE EARTH’S RADIUS, MASS, AND GRAVITIONAL CONSTANT  - PHYSIC...
DETERMINATION OF THE EARTH’S RADIUS, MASS, AND GRAVITIONAL CONSTANT - PHYSIC...
Ahmed Nassar
 
Remote Sensing - Operating Satellites
Remote Sensing -  Operating SatellitesRemote Sensing -  Operating Satellites
Remote Sensing - Operating Satellites
Ahmed Nassar
 
Photogrammetry - Stereoscopic Parallax
Photogrammetry - Stereoscopic ParallaxPhotogrammetry - Stereoscopic Parallax
Photogrammetry - Stereoscopic Parallax
Ahmed Nassar
 
Hydrographic Surveying - Depth Sounding Equipment
Hydrographic Surveying - Depth Sounding EquipmentHydrographic Surveying - Depth Sounding Equipment
Hydrographic Surveying - Depth Sounding Equipment
Ahmed Nassar
 
Hydrographic Surveying - Geodetic Control And Tidal Effects
Hydrographic Surveying - Geodetic Control And Tidal Effects Hydrographic Surveying - Geodetic Control And Tidal Effects
Hydrographic Surveying - Geodetic Control And Tidal Effects
Ahmed Nassar
 
Hydrographic Surveying - Positioning
Hydrographic Surveying - PositioningHydrographic Surveying - Positioning
Hydrographic Surveying - Positioning
Ahmed Nassar
 
Hydrographic Surveying - Basic Measurements And Equipments
Hydrographic Surveying - Basic Measurements And EquipmentsHydrographic Surveying - Basic Measurements And Equipments
Hydrographic Surveying - Basic Measurements And Equipments
Ahmed Nassar
 
حقوق الانسان في مصر الفرعونية
حقوق الانسان في مصر الفرعونيةحقوق الانسان في مصر الفرعونية
حقوق الانسان في مصر الفرعونية
Ahmed Nassar
 
The Importance of Railway in Transportation
The Importance of Railway in TransportationThe Importance of Railway in Transportation
The Importance of Railway in Transportation
Ahmed Nassar
 
Geometric Design of Roads and Highways
Geometric Design of Roads and HighwaysGeometric Design of Roads and Highways
Geometric Design of Roads and Highways
Ahmed Nassar
 
The Function of Electric Power Systems
The Function of Electric Power SystemsThe Function of Electric Power Systems
The Function of Electric Power Systems
Ahmed Nassar
 
Types of Gears
Types of GearsTypes of Gears
Types of Gears
Ahmed Nassar
 
Photogrammetry: Stereoscopy and Parallax
Photogrammetry: Stereoscopy and ParallaxPhotogrammetry: Stereoscopy and Parallax
Photogrammetry: Stereoscopy and Parallax
Ahmed Nassar
 
Geodesy - Definition, Types, Uses and Applications
Geodesy - Definition, Types, Uses and ApplicationsGeodesy - Definition, Types, Uses and Applications
Geodesy - Definition, Types, Uses and Applications
Ahmed Nassar
 
Geology - rocks | جيولوجيا - الصخور
Geology - rocks | جيولوجيا - الصخورGeology - rocks | جيولوجيا - الصخور
Geology - rocks | جيولوجيا - الصخور
Ahmed Nassar
 
Geology - earthquakes | جيولوجيا - الزلازل
Geology - earthquakes | جيولوجيا - الزلازلGeology - earthquakes | جيولوجيا - الزلازل
Geology - earthquakes | جيولوجيا - الزلازل
Ahmed Nassar
 
Photogrammetry - Space Resection by Collinearity Equations
Photogrammetry - Space Resection by Collinearity EquationsPhotogrammetry - Space Resection by Collinearity Equations
Photogrammetry - Space Resection by Collinearity Equations
Ahmed Nassar
 
Geodetic Astronomy - MOTION IN THE HEAVENS - EARTH, SUN AND STARS
Geodetic Astronomy - MOTION IN THE HEAVENS - EARTH, SUN AND STARSGeodetic Astronomy - MOTION IN THE HEAVENS - EARTH, SUN AND STARS
Geodetic Astronomy - MOTION IN THE HEAVENS - EARTH, SUN AND STARS
Ahmed Nassar
 
PHOTOGRAMMETRY: GROUND CONTROL FOR AERIAL PHOTOGRAMMETRY نقاط الضبط الأرضي في...
PHOTOGRAMMETRY: GROUND CONTROL FOR AERIAL PHOTOGRAMMETRY نقاط الضبط الأرضي في...PHOTOGRAMMETRY: GROUND CONTROL FOR AERIAL PHOTOGRAMMETRY نقاط الضبط الأرضي في...
PHOTOGRAMMETRY: GROUND CONTROL FOR AERIAL PHOTOGRAMMETRY نقاط الضبط الأرضي في...
Ahmed Nassar
 
Hydrographic Surveying : Safe Navigation
Hydrographic Surveying : Safe Navigation Hydrographic Surveying : Safe Navigation
Hydrographic Surveying : Safe Navigation
Ahmed Nassar
 
DETERMINATION OF THE EARTH’S RADIUS, MASS, AND GRAVITIONAL CONSTANT - PHYSIC...
DETERMINATION OF THE EARTH’S RADIUS, MASS, AND GRAVITIONAL CONSTANT  - PHYSIC...DETERMINATION OF THE EARTH’S RADIUS, MASS, AND GRAVITIONAL CONSTANT  - PHYSIC...
DETERMINATION OF THE EARTH’S RADIUS, MASS, AND GRAVITIONAL CONSTANT - PHYSIC...
Ahmed Nassar
 
Remote Sensing - Operating Satellites
Remote Sensing -  Operating SatellitesRemote Sensing -  Operating Satellites
Remote Sensing - Operating Satellites
Ahmed Nassar
 
Photogrammetry - Stereoscopic Parallax
Photogrammetry - Stereoscopic ParallaxPhotogrammetry - Stereoscopic Parallax
Photogrammetry - Stereoscopic Parallax
Ahmed Nassar
 
Hydrographic Surveying - Depth Sounding Equipment
Hydrographic Surveying - Depth Sounding EquipmentHydrographic Surveying - Depth Sounding Equipment
Hydrographic Surveying - Depth Sounding Equipment
Ahmed Nassar
 
Hydrographic Surveying - Geodetic Control And Tidal Effects
Hydrographic Surveying - Geodetic Control And Tidal Effects Hydrographic Surveying - Geodetic Control And Tidal Effects
Hydrographic Surveying - Geodetic Control And Tidal Effects
Ahmed Nassar
 
Hydrographic Surveying - Positioning
Hydrographic Surveying - PositioningHydrographic Surveying - Positioning
Hydrographic Surveying - Positioning
Ahmed Nassar
 
Hydrographic Surveying - Basic Measurements And Equipments
Hydrographic Surveying - Basic Measurements And EquipmentsHydrographic Surveying - Basic Measurements And Equipments
Hydrographic Surveying - Basic Measurements And Equipments
Ahmed Nassar
 
حقوق الانسان في مصر الفرعونية
حقوق الانسان في مصر الفرعونيةحقوق الانسان في مصر الفرعونية
حقوق الانسان في مصر الفرعونية
Ahmed Nassar
 
The Importance of Railway in Transportation
The Importance of Railway in TransportationThe Importance of Railway in Transportation
The Importance of Railway in Transportation
Ahmed Nassar
 
Geometric Design of Roads and Highways
Geometric Design of Roads and HighwaysGeometric Design of Roads and Highways
Geometric Design of Roads and Highways
Ahmed Nassar
 
The Function of Electric Power Systems
The Function of Electric Power SystemsThe Function of Electric Power Systems
The Function of Electric Power Systems
Ahmed Nassar
 
Photogrammetry: Stereoscopy and Parallax
Photogrammetry: Stereoscopy and ParallaxPhotogrammetry: Stereoscopy and Parallax
Photogrammetry: Stereoscopy and Parallax
Ahmed Nassar
 
Geodesy - Definition, Types, Uses and Applications
Geodesy - Definition, Types, Uses and ApplicationsGeodesy - Definition, Types, Uses and Applications
Geodesy - Definition, Types, Uses and Applications
Ahmed Nassar
 
Geology - rocks | جيولوجيا - الصخور
Geology - rocks | جيولوجيا - الصخورGeology - rocks | جيولوجيا - الصخور
Geology - rocks | جيولوجيا - الصخور
Ahmed Nassar
 
Geology - earthquakes | جيولوجيا - الزلازل
Geology - earthquakes | جيولوجيا - الزلازلGeology - earthquakes | جيولوجيا - الزلازل
Geology - earthquakes | جيولوجيا - الزلازل
Ahmed Nassar
 
Photogrammetry - Space Resection by Collinearity Equations
Photogrammetry - Space Resection by Collinearity EquationsPhotogrammetry - Space Resection by Collinearity Equations
Photogrammetry - Space Resection by Collinearity Equations
Ahmed Nassar
 
Geodetic Astronomy - MOTION IN THE HEAVENS - EARTH, SUN AND STARS
Geodetic Astronomy - MOTION IN THE HEAVENS - EARTH, SUN AND STARSGeodetic Astronomy - MOTION IN THE HEAVENS - EARTH, SUN AND STARS
Geodetic Astronomy - MOTION IN THE HEAVENS - EARTH, SUN AND STARS
Ahmed Nassar
 
PHOTOGRAMMETRY: GROUND CONTROL FOR AERIAL PHOTOGRAMMETRY نقاط الضبط الأرضي في...
PHOTOGRAMMETRY: GROUND CONTROL FOR AERIAL PHOTOGRAMMETRY نقاط الضبط الأرضي في...PHOTOGRAMMETRY: GROUND CONTROL FOR AERIAL PHOTOGRAMMETRY نقاط الضبط الأرضي في...
PHOTOGRAMMETRY: GROUND CONTROL FOR AERIAL PHOTOGRAMMETRY نقاط الضبط الأرضي في...
Ahmed Nassar
 
Ad

Recently uploaded (20)

2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Uses of drones in civil construction.pdf
Uses of drones in civil construction.pdfUses of drones in civil construction.pdf
Uses of drones in civil construction.pdf
surajsen1729
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
Artificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptxArtificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptx
rakshanatarajan005
 
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Journal of Soft Computing in Civil Engineering
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
AI Publications
 
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
Guru Nanak Technical Institutions
 
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning ModelsMode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Journal of Soft Computing in Civil Engineering
 
Working with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to ImplementationWorking with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to Implementation
Alabama Transportation Assistance Program
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
introduction technology technology tec.pptx
introduction technology technology tec.pptxintroduction technology technology tec.pptx
introduction technology technology tec.pptx
Iftikhar70
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Journal of Soft Computing in Civil Engineering
 
Machine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATIONMachine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATION
DarrinBright1
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Uses of drones in civil construction.pdf
Uses of drones in civil construction.pdfUses of drones in civil construction.pdf
Uses of drones in civil construction.pdf
surajsen1729
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
Artificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptxArtificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptx
rakshanatarajan005
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
AI Publications
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
introduction technology technology tec.pptx
introduction technology technology tec.pptxintroduction technology technology tec.pptx
introduction technology technology tec.pptx
Iftikhar70
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
Machine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATIONMachine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATION
DarrinBright1
 
Ad

Notes on MATLAB - Basic Cheatsheet

  • 1. MATLAB NOTES 1 MATLAB NOTES BY AHMED Y. NASSAR Surveying Department Faculty of Engineering, Shoubra Benha University
  • 2. MATLAB NOTES 2 To create a matrix that has multiple rows, separate the rows with semicolons. >> a = [1 2 3; 4 5 6; 7 8 10] a = 1 2 3 4 5 6 7 8 10 Another way to create a matrix is to use a function, such as ones, zeros, or rand. For example, create a 5-by-1 column vector of zeros. >> z = zeros(5,1) z = 0 0 0 0 0 >> z = ones(5,2)
  • 3. MATLAB NOTES 3 z = 1 1 1 1 1 1 1 1 1 1 >> z = rand(5,3) z = 0.8147 0.0975 0.1576 0.9058 0.2785 0.9706 0.1270 0.5469 0.9572 0.9134 0.9575 0.4854 0.6324 0.9649 0.8003 To transpose a matrix, use a single quote ('): >> a' ans = 1 4 7 2 5 8 3 6 10 >> a + 10
  • 4. MATLAB NOTES 4 ans = 11 12 13 14 15 16 17 18 20 To perform element-wise multiplication rather than matrix multiplication, use the .* operator: >> p = a.*a p = 1 4 9 16 25 36 49 64 100 To perform Natural Matrix multiplication, use the * operator: >> a * a ans = 30 36 45 66 81 102 109 134 169
  • 5. MATLAB NOTES 5 Concatenation >> A = [a,a] A = 1 2 3 1 2 3 4 5 6 4 5 6 7 8 10 7 8 10 >> A = [a; a] A = 1 2 3 4 5 6 7 8 10 1 2 3 4 5 6 7 8 10 When you want to access selected elements of an array, use indexing. >> a(2,2) ans = 5
  • 6. MATLAB NOTES 6 use a single subscript that traverses down each column in order: >> a(6) ans = 8 The colon operator also allows you to create an equally spaced vector of values using the form start:step:end. >> b = 0:20:200 b = 0 20 40 60 80 100 120 140 160 180 200 sqrt(X) is the square root of the elements of X. Complex results are produced if X is not positive. >> sqrt((-2:2)') ans = 0.0000 + 1.4142i 0.0000 + 1.0000i 0.0000 + 0.0000i 1.0000 + 0.0000i 1.4142 + 0.0000i
  翻译: