SlideShare a Scribd company logo
1 of 21
IT-2210 : Computational
mathematics LAB with
MATLAB
4/10/2017MATLAB by Tajim 1
Lecture 2: MATLAB basic
syntax and variables
4/10/2017MATLAB by Tajim 2
4/10/2017MATLAB by Tajim 3
Commonly used Operators and Special Characters
4/10/2017MATLAB by Tajim 4
Do some basic operations and see the results
MATLAB environment behaves like a super-
complex calculator. You can enter commands at the
>> command prompt.
MATLAB is an interpreted environment. In other
words, you give a command and MATLAB executes
it right away.
Type a valid expression and press enter.
When you click the Execute button, or type Ctrl+E,
MATLAB executes it immediately and the result
returned.
4/10/2017MATLAB by Tajim 5
4/10/2017MATLAB by Tajim 6
The percent symbol (%) is
used for indicating a comment
line.
4/10/2017MATLAB by Tajim 7
Note: MATLAB provides some special expressions for
some mathematical symbols, like pi for π, Inf for ∞, i
(and j) for √-1 etc. Nan stands for 'not a number'.
Use of Semicolon (;) in
MATLAB:
Semicolon (;) indicates end
of statement. However, if
you want to suppress and
hide the MATLAB output for
an expression, add a
semicolon after the
expression.
4/10/2017MATLAB by Tajim 8
Special Variables and Constants
Name Meaning
ans Most recent answer.
eps Accuracy of floating-point precision.
i,j The imaginary unit √-1.
Inf Infinity.
NaN Undefined numerical result (not a number).
pi The number π
MATLAB supports the following special variables and
constants:
4/10/2017MATLAB by Tajim 9
Naming and Saving
4/10/2017MATLAB by Tajim 10
Save as
“file.m”
4/10/2017MATLAB by Tajim 11
MATLAB - Variables
Please note that:
•Once a variable is entered into the system,
you can refer to it later.
•Variables must have values before they are
used.
•When an expression returns a result that is
not assigned to any variable, the system
assigns it to a variable named ans, which can
be used later.
4/10/2017MATLAB by Tajim 12
4/10/2017MATLAB by Tajim 13
4/10/2017MATLAB by Tajim 14
4/10/2017MATLAB by Tajim 15
Clear and long assignment
4/10/2017MATLAB by Tajim 16
4/10/2017MATLAB by Tajim 17
Exponential Results
4/10/2017MATLAB by Tajim 18
Creating Vectors
A vector is a one-dimensional array of
numbers. MATLAB allows creating two
types of vectors:
•Row vectors
•Column vectors
Row vectors are created by enclosing the
set of elements in square brackets, using
space or comma to delimit the elements.
Column vectors are created by enclosing the
set of elements in square brackets, using
semicolon(;) to delimit the elements.
4/10/2017MATLAB by Tajim 19
Row
vector
Column
Vector
4/10/2017MATLAB by Tajim 20
Matrices in MATLAB
4/10/2017MATLAB by Tajim 21
End of
LECTURE TWO
Thank You .

More Related Content

What's hot

Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programmingsavitamhaske
 
Modul Pratikum Algoritma dan Pemrograman dalam Bahasa Visual C++ 2010
Modul Pratikum Algoritma dan Pemrograman dalam Bahasa Visual C++ 2010Modul Pratikum Algoritma dan Pemrograman dalam Bahasa Visual C++ 2010
Modul Pratikum Algoritma dan Pemrograman dalam Bahasa Visual C++ 2010eddie Ismantoe
 
B sc it syit sem 3 sem 4 syllabus as per mumbai university
B sc it syit sem 3 sem 4 syllabus as per mumbai universityB sc it syit sem 3 sem 4 syllabus as per mumbai university
B sc it syit sem 3 sem 4 syllabus as per mumbai universitytanujaparihar
 
Analysis and Design of Algorithms
Analysis and Design of AlgorithmsAnalysis and Design of Algorithms
Analysis and Design of AlgorithmsBulbul Agrawal
 
Minimum Spanning Tree
Minimum Spanning TreeMinimum Spanning Tree
Minimum Spanning Treezhaokatherine
 
KRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraKRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraguest1f4fb3
 
MATLAB Programming - Loop Control Part 2
MATLAB Programming - Loop Control Part 2MATLAB Programming - Loop Control Part 2
MATLAB Programming - Loop Control Part 2Shameer Ahmed Koya
 
Programming for Problem Solving
Programming for Problem SolvingProgramming for Problem Solving
Programming for Problem SolvingSukhendra Singh
 
Materi Kuliah : Dasar pemrograman 1
Materi Kuliah : Dasar pemrograman 1Materi Kuliah : Dasar pemrograman 1
Materi Kuliah : Dasar pemrograman 1Braga Rezpect
 
Cost optimal algorithm
Cost optimal algorithmCost optimal algorithm
Cost optimal algorithmHeman Pathak
 
1 - Introduction to Compilers.ppt
1 - Introduction to Compilers.ppt1 - Introduction to Compilers.ppt
1 - Introduction to Compilers.pptRakesh Kumar
 

What's hot (20)

Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
 
Linkers in compiler
Linkers in compilerLinkers in compiler
Linkers in compiler
 
Modul Pratikum Algoritma dan Pemrograman dalam Bahasa Visual C++ 2010
Modul Pratikum Algoritma dan Pemrograman dalam Bahasa Visual C++ 2010Modul Pratikum Algoritma dan Pemrograman dalam Bahasa Visual C++ 2010
Modul Pratikum Algoritma dan Pemrograman dalam Bahasa Visual C++ 2010
 
B sc it syit sem 3 sem 4 syllabus as per mumbai university
B sc it syit sem 3 sem 4 syllabus as per mumbai universityB sc it syit sem 3 sem 4 syllabus as per mumbai university
B sc it syit sem 3 sem 4 syllabus as per mumbai university
 
Analysis and Design of Algorithms
Analysis and Design of AlgorithmsAnalysis and Design of Algorithms
Analysis and Design of Algorithms
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Minimum Spanning Tree
Minimum Spanning TreeMinimum Spanning Tree
Minimum Spanning Tree
 
KRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraKRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitra
 
Modul Pemrograman Bahasa Assembly
Modul Pemrograman Bahasa AssemblyModul Pemrograman Bahasa Assembly
Modul Pemrograman Bahasa Assembly
 
MATLAB Programming - Loop Control Part 2
MATLAB Programming - Loop Control Part 2MATLAB Programming - Loop Control Part 2
MATLAB Programming - Loop Control Part 2
 
Control structures in C
Control structures in CControl structures in C
Control structures in C
 
Programming for Problem Solving
Programming for Problem SolvingProgramming for Problem Solving
Programming for Problem Solving
 
Matlab GUI
Matlab GUIMatlab GUI
Matlab GUI
 
Materi Kuliah : Dasar pemrograman 1
Materi Kuliah : Dasar pemrograman 1Materi Kuliah : Dasar pemrograman 1
Materi Kuliah : Dasar pemrograman 1
 
Cost optimal algorithm
Cost optimal algorithmCost optimal algorithm
Cost optimal algorithm
 
1 - Introduction to Compilers.ppt
1 - Introduction to Compilers.ppt1 - Introduction to Compilers.ppt
1 - Introduction to Compilers.ppt
 
Identifiers
Identifiers Identifiers
Identifiers
 
Pseudo code
Pseudo codePseudo code
Pseudo code
 
Bahasa Pemprograman c
Bahasa Pemprograman cBahasa Pemprograman c
Bahasa Pemprograman c
 
C# Lab Programs.pdf
C# Lab Programs.pdfC# Lab Programs.pdf
C# Lab Programs.pdf
 

Similar to Matlab lecture 2 matlab basic syntax & variables @taj

Similar to Matlab lecture 2 matlab basic syntax & variables @taj (20)

Ch1
Ch1Ch1
Ch1
 
MATLAB Basics-Part1
MATLAB Basics-Part1MATLAB Basics-Part1
MATLAB Basics-Part1
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Matlab Manual
Matlab ManualMatlab Manual
Matlab Manual
 
Handout2.pdf
Handout2.pdfHandout2.pdf
Handout2.pdf
 
Matlab tutorial 3
Matlab tutorial 3Matlab tutorial 3
Matlab tutorial 3
 
Matlab tut2
Matlab tut2Matlab tut2
Matlab tut2
 
MATLAB INTRODUCTION
MATLAB INTRODUCTIONMATLAB INTRODUCTION
MATLAB 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
 
Matlab - Introduction and Basics
Matlab - Introduction and BasicsMatlab - Introduction and Basics
Matlab - Introduction and Basics
 
Matlab for diploma students(1)
Matlab for diploma students(1)Matlab for diploma students(1)
Matlab for diploma students(1)
 
Matlab guide
Matlab guideMatlab guide
Matlab guide
 
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
 
Lab5
Lab5Lab5
Lab5
 
Matlab syntax
Matlab syntaxMatlab syntax
Matlab syntax
 
Matopt
MatoptMatopt
Matopt
 
1. Ch_1 SL_1_Intro to Matlab.pptx
1. Ch_1 SL_1_Intro to Matlab.pptx1. Ch_1 SL_1_Intro to Matlab.pptx
1. Ch_1 SL_1_Intro to Matlab.pptx
 
Matlab tutorial 4
Matlab tutorial 4Matlab tutorial 4
Matlab tutorial 4
 
Matlab practical and lab session
Matlab practical and lab sessionMatlab practical and lab session
Matlab practical and lab session
 
MATLAB BASICS
MATLAB BASICSMATLAB BASICS
MATLAB BASICS
 

More from Tajim Md. Niamat Ullah Akhund

Artificial intelligence LAB 1 overview & intelligent systems
Artificial intelligence LAB 1   overview & intelligent systemsArtificial intelligence LAB 1   overview & intelligent systems
Artificial intelligence LAB 1 overview & intelligent systemsTajim Md. Niamat Ullah Akhund
 
Matlab lecture 9 – simpson 1,3 and trapezoidal method@taj
Matlab lecture 9 – simpson 1,3 and trapezoidal method@tajMatlab lecture 9 – simpson 1,3 and trapezoidal method@taj
Matlab lecture 9 – simpson 1,3 and trapezoidal method@tajTajim Md. Niamat Ullah Akhund
 
Matlab lecture 8 – newton's forward and backword interpolation@taj copy
Matlab lecture 8 – newton's forward and backword interpolation@taj   copyMatlab lecture 8 – newton's forward and backword interpolation@taj   copy
Matlab lecture 8 – newton's forward and backword interpolation@taj copyTajim Md. Niamat Ullah Akhund
 
Matlab lecture 7 – regula falsi or false position method@taj
Matlab lecture 7 – regula falsi or false position method@tajMatlab lecture 7 – regula falsi or false position method@taj
Matlab lecture 7 – regula falsi or false position method@tajTajim Md. Niamat Ullah Akhund
 
Matlab lecture 3 – commands, the m files, data types, bitwise op, set@taj
Matlab lecture 3 – commands, the m files, data types, bitwise op, set@tajMatlab lecture 3 – commands, the m files, data types, bitwise op, set@taj
Matlab lecture 3 – commands, the m files, data types, bitwise op, set@tajTajim Md. Niamat Ullah Akhund
 
Circuit lab 9 verification of maximum power transfer theorem@taj
Circuit lab 9  verification of maximum power transfer theorem@tajCircuit lab 9  verification of maximum power transfer theorem@taj
Circuit lab 9 verification of maximum power transfer theorem@tajTajim Md. Niamat Ullah Akhund
 
Circuit lab 8 verification of thevenin's theorem@taj
Circuit lab 8  verification of thevenin's theorem@tajCircuit lab 8  verification of thevenin's theorem@taj
Circuit lab 8 verification of thevenin's theorem@tajTajim Md. Niamat Ullah Akhund
 
Circuit lab 7 verification of superposition theorem@taj
Circuit lab 7  verification of superposition theorem@tajCircuit lab 7  verification of superposition theorem@taj
Circuit lab 7 verification of superposition theorem@tajTajim Md. Niamat Ullah Akhund
 

More from Tajim Md. Niamat Ullah Akhund (20)

AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)
 
AI Lecture 6 (logical agents)
AI Lecture 6 (logical agents)AI Lecture 6 (logical agents)
AI Lecture 6 (logical agents)
 
AI Lecture 5 (game playing)
AI Lecture 5 (game playing)AI Lecture 5 (game playing)
AI Lecture 5 (game playing)
 
AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
 
AI Lecture 2 (intelligent agents)
AI Lecture 2 (intelligent agents)AI Lecture 2 (intelligent agents)
AI Lecture 2 (intelligent agents)
 
AI Lecture 1 (introduction)
AI Lecture 1 (introduction)AI Lecture 1 (introduction)
AI Lecture 1 (introduction)
 
Course outline (cse 412 - artificial intelligence)
Course outline (cse   412 - artificial intelligence)Course outline (cse   412 - artificial intelligence)
Course outline (cse 412 - artificial intelligence)
 
Artificial intelligence LAB 1 overview & intelligent systems
Artificial intelligence LAB 1   overview & intelligent systemsArtificial intelligence LAB 1   overview & intelligent systems
Artificial intelligence LAB 1 overview & intelligent systems
 
Matlab lecture 9 – simpson 1,3 and trapezoidal method@taj
Matlab lecture 9 – simpson 1,3 and trapezoidal method@tajMatlab lecture 9 – simpson 1,3 and trapezoidal method@taj
Matlab lecture 9 – simpson 1,3 and trapezoidal method@taj
 
Matlab lecture 8 – newton's forward and backword interpolation@taj copy
Matlab lecture 8 – newton's forward and backword interpolation@taj   copyMatlab lecture 8 – newton's forward and backword interpolation@taj   copy
Matlab lecture 8 – newton's forward and backword interpolation@taj copy
 
Matlab lecture 7 – regula falsi or false position method@taj
Matlab lecture 7 – regula falsi or false position method@tajMatlab lecture 7 – regula falsi or false position method@taj
Matlab lecture 7 – regula falsi or false position method@taj
 
Matlab lecture 6 – newton raphson method@taj copy
Matlab lecture 6 – newton raphson method@taj   copyMatlab lecture 6 – newton raphson method@taj   copy
Matlab lecture 6 – newton raphson method@taj copy
 
Matlab lecture 5 bisection method@taj
Matlab lecture 5  bisection method@tajMatlab lecture 5  bisection method@taj
Matlab lecture 5 bisection method@taj
 
Matlab lecture 4 loops@taj
Matlab lecture 4  loops@tajMatlab lecture 4  loops@taj
Matlab lecture 4 loops@taj
 
Matlab lecture 3 – commands, the m files, data types, bitwise op, set@taj
Matlab lecture 3 – commands, the m files, data types, bitwise op, set@tajMatlab lecture 3 – commands, the m files, data types, bitwise op, set@taj
Matlab lecture 3 – commands, the m files, data types, bitwise op, set@taj
 
Circuit lab 10 verification of norton's theorem@taj
Circuit lab 10  verification of norton's theorem@tajCircuit lab 10  verification of norton's theorem@taj
Circuit lab 10 verification of norton's theorem@taj
 
Circuit lab 9 verification of maximum power transfer theorem@taj
Circuit lab 9  verification of maximum power transfer theorem@tajCircuit lab 9  verification of maximum power transfer theorem@taj
Circuit lab 9 verification of maximum power transfer theorem@taj
 
Circuit lab 8 verification of thevenin's theorem@taj
Circuit lab 8  verification of thevenin's theorem@tajCircuit lab 8  verification of thevenin's theorem@taj
Circuit lab 8 verification of thevenin's theorem@taj
 
Circuit lab 7 verification of superposition theorem@taj
Circuit lab 7  verification of superposition theorem@tajCircuit lab 7  verification of superposition theorem@taj
Circuit lab 7 verification of superposition theorem@taj
 

Recently uploaded

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 

Recently uploaded (20)

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 

Matlab lecture 2 matlab basic syntax & variables @taj

  • 1. IT-2210 : Computational mathematics LAB with MATLAB 4/10/2017MATLAB by Tajim 1
  • 2. Lecture 2: MATLAB basic syntax and variables 4/10/2017MATLAB by Tajim 2
  • 3. 4/10/2017MATLAB by Tajim 3 Commonly used Operators and Special Characters
  • 4. 4/10/2017MATLAB by Tajim 4 Do some basic operations and see the results MATLAB environment behaves like a super- complex calculator. You can enter commands at the >> command prompt. MATLAB is an interpreted environment. In other words, you give a command and MATLAB executes it right away. Type a valid expression and press enter. When you click the Execute button, or type Ctrl+E, MATLAB executes it immediately and the result returned.
  • 6. 4/10/2017MATLAB by Tajim 6 The percent symbol (%) is used for indicating a comment line.
  • 7. 4/10/2017MATLAB by Tajim 7 Note: MATLAB provides some special expressions for some mathematical symbols, like pi for π, Inf for ∞, i (and j) for √-1 etc. Nan stands for 'not a number'. Use of Semicolon (;) in MATLAB: Semicolon (;) indicates end of statement. However, if you want to suppress and hide the MATLAB output for an expression, add a semicolon after the expression.
  • 8. 4/10/2017MATLAB by Tajim 8 Special Variables and Constants Name Meaning ans Most recent answer. eps Accuracy of floating-point precision. i,j The imaginary unit √-1. Inf Infinity. NaN Undefined numerical result (not a number). pi The number π MATLAB supports the following special variables and constants:
  • 9. 4/10/2017MATLAB by Tajim 9 Naming and Saving
  • 10. 4/10/2017MATLAB by Tajim 10 Save as “file.m”
  • 11. 4/10/2017MATLAB by Tajim 11 MATLAB - Variables Please note that: •Once a variable is entered into the system, you can refer to it later. •Variables must have values before they are used. •When an expression returns a result that is not assigned to any variable, the system assigns it to a variable named ans, which can be used later.
  • 15. 4/10/2017MATLAB by Tajim 15 Clear and long assignment
  • 17. 4/10/2017MATLAB by Tajim 17 Exponential Results
  • 18. 4/10/2017MATLAB by Tajim 18 Creating Vectors A vector is a one-dimensional array of numbers. MATLAB allows creating two types of vectors: •Row vectors •Column vectors Row vectors are created by enclosing the set of elements in square brackets, using space or comma to delimit the elements. Column vectors are created by enclosing the set of elements in square brackets, using semicolon(;) to delimit the elements.
  • 19. 4/10/2017MATLAB by Tajim 19 Row vector Column Vector
  • 20. 4/10/2017MATLAB by Tajim 20 Matrices in MATLAB
  • 21. 4/10/2017MATLAB by Tajim 21 End of LECTURE TWO Thank You .