SlideShare una empresa de Scribd logo
1 de 24
Eng.Ahmed Farouk 01026409833
Session 1
Content
 What is Matlab ?
 Introducing the Matlab Development Environment
 Performing Basic Arithmetic,
 Performing Logical and Relational Operations
Eng.Ahmed Farouk 01026409833
What is Matlab?
 The name Matlab stands for matrix laboratory.
 It is a high-performance language for technical computing.
 Matlab can deal with Modeling ,simulation , Data analysis , Scientific and
engineering graphics,…….
 Matlab can deal with sounds, images ,text, excel data,…… .
 Matlab is an interactive system whose basic data element is an array
that does not require dimensioning. This allows you to solve many
technical computing problems, especially those with matrix and vector
formulations, in a fraction of the time it would take to write a program in a
scalar non-interactive language such as C or Fortran.
Eng.Ahmed Farouk 01026409833
Introducing the Matlab Development
Environment
If you happen to get employed in a new place, the first thing you would
probably do is to take a brief tour to experience your new
workplace and its subdivisions, or what we alternatively refer to by
the term “Development Environment”.
For someone working in a factory, the development environment refers
to the work place with all its subdivisions and all the resources and
tools it contains.
For Matlab users, the development environment refers similarly to the
Matlab window and all the resources and tools it contains.
The first step in understanding how Matlab works is to experience its
development environment.
Eng.Ahmed Farouk 01026409833
 When you start Matlab, the figure on the next page depicts what you
will see.
Eng.Ahmed Farouk 01026409833
Eng.Ahmed Farouk 01026409833
The Command Window
 The command window is an interpreter where you can write and
execute instructions one at a time or few at a time.
 You know where to write your next instruction from the „>>‟ mark,
which is called the command prompt.
The Workspace Browser
 The workspace is the group of variables (arrays) you are working with.
 The workspace browser provides you with an overview of the workspace,
meaning that it shows you the variable you have created so far.
 It shows you the variable name, size, data type and its value if the value is
compact enough to be displayed, such as that of a single number or few
characters.
 By double clicking on any variable, you get to inspect this variable in detail.
Eng.Ahmed Farouk 01026409833
The Command History
 It is an archive of commands previously executed in the command window.
You may use it to retrieve and re-execute previous commands.
 The command window doesn‟t log your commands from the day you first
opened Matlab; it has a maximum buffer size.
 Once reached, any new command will append to the bottom of the buffer,
causing the topmost command to be lost.
 By setting the buffer size to 10,000 for instance, you can make the command
window “remember” your last 10,000 commands.
Eng.Ahmed Farouk 01026409833
The Current Directory
 Below the workspace, you can see a tab selection that
lets you select either the workspace or the current
directory to view.
 Click on the “Current Directory” tab.
 The current directory is a folder you choose to be your
default working folder.
 Whenever Matlab requires a user file, it will start its
search by looking into this folder.
 Whenever Matlab needs to save a user file, it will save it
in this folder by default.
Eng.Ahmed Farouk 01026409833
The rest of the elements of the development environment
do not appear at startup by default, but you can call
them whenever you need them. We continue our
discussion of the development environment by looking at the
rest of its elements like:
 The Array Editor.
 The M-File Editor.
 The Figure Window.
 The GUI Development Environment (GUIDE).
 Simulink.
Eng.Ahmed Farouk 01026409833
The Array Editor
 The array editor is a window that opens to show you the contents of a
variable (array) and possibly make you change these contents.
 The array editor opens when you double click on a variable in the workspace
browser.
 The figure below shows an instant of the array editor opened to show us
variable “ImA”, a matrix resulting from loading an image into the workspace.
The M-File Editor
 The M-File Editor is a text-entry window where you can write down complete
programs.
 The following figure depicts the M-File editor.
 You can start the M-File editor by typing edit at the command prompt (>>edit)
or by clicking the New M-File button on the startup screen.
 The M-File editor contains facilities for writing, debugging and running your
programs.
Eng.Ahmed Farouk 01026409833
The Figure Window
 A figure window is a window used with graphics.
 A graphic cannot be displayed in the command window.
 Therefore it opens in a separate window equipped with facilities for handling
graphic, which is the figure window.
The GUI Development Environment(GUIDE)
 The GUIDE is a tool for building GUIs like the one shown above.
 The GUIDE may be started by typing guide at the command prompt (>>guide)
or by going to New -> GUI in the Matlab File menu.
 The development environment for GUIs will then open. The GUI tool looks as
depicted in the figure below.
Simulink
 Simulink is a Matlab-associated package used for system design, modeling and
system analysis.
 The figure below shows an example of a house thermodynamic subsystem
designed using Simulink.
Eng.Ahmed Farouk 01026409833
Basic Arithmetic,
Relational and Logical
Operations
Eng.Ahmed Farouk 01026409833
Basic Arithmetic, Relational and Logical
Operations
 Matlab always starts by evaluating the right-hand-side (RHS) of the
expression, which is (2 + 3).
 This operation evaluates to (5).
 So Matlab will try to assign the value 5 to the left-hand-side (LHS), which is
(E).
 However, the variable (E) does not exist yet, so Matlab will create a variable
called (E) then carry out the assignment.
 Hence the result of this expression is that E equals 5.
Eng.Ahmed Farouk 01026409833
Basic Arithmetic, Relational and
Logical Operations
Note:
 If the variable E already existed, its previous contents will be replaced
by the result of evaluating the new expression.
 If the expression contains an operation without a LHS variable to which the
result may be assigned, Matlab automatically uses a default variable
called “ans‟ standing for “answer”. To try this, write (>> 2+3).
 If you append any expression by a semicolon (;), the expression will
be evaluated normally, but the output of its evaluation won’t be
reported in the command prompt.
Eng.Ahmed Farouk 01026409833
Arithmetic Operations
 The following table shows a list of the available arithmetic operations and
their description.
Eng.Ahmed Farouk 01026409833
Logical Operations
 In arithmetic operations, the operands may have any numerical values.
 In logical operations, the operands may have one of two values: either
nonzero or zero (also called true or false).
 In input operands, 0 is used to indicate (logic 0), while any number other than
0 may be used to indicate (logic 1).
 In the results of a logical operation, a 0 is always used to indicate (logic 0)
while a 1 is always used to indicate (logic 1).
Eng.Ahmed Farouk 01026409833
Logical Operations
Note:
 Other logical operations such as NANDing, NORing and XNORing may be
performed by combining two or more of the previous operators.
 Example: c=~(A|B) is equivalent to NORing A with B then assigning the result to c.
Logic 0 is also referred to as „False‟, and logic 1 is also referred to as „True‟.
Examples:
 >>a=-5;b=2;c=0;
 >>x=a & b ;
 %x=1
 >>y=c & b ;
 %y=0
 >>z=c | b ;
 %z=1
 >>w=~b ;
 %w=0
Note:
 You can get up to the previous commands by using the up and down arrows.
Relational Tests
 Relational operations are simple in their concept. A relational operation is a
test done on a certain expression. Hence, they are also called relational
tests.
 The test evaluates to (Logic 1) if the expression is true and evaluates to
(Logic 0) if the expression is false.
Eng.Ahmed Farouk 01026409833
Relational Tests
Examples:
 >>a=5;b=2;
 >>x=a>b;
 %x=1
 >>x=(a~=b)
 %x=1
Note:
 Many users confuse the double equality sign (==) used in relational tests with
the equality sign (=) used in assignments.
 When a user uses (=) instead of (==), Matlab usually reports that an expected
relational operator wasn’t found.
Eng.Ahmed Farouk 01026409833
Combining Different Operations
 Let us assume that we want to operate an alarm mechanism if an “automatic
temperature alarm” button is pressed and the room temperature exceeds the
nominal by 5 degrees.
 The status of the “automatic temperature alarm” button is 0 if the button is
not pressed and is 1 if the button is pressed.
 The temperature is read by a sensor.
 We may use Matlab interfacing techniques to read the status of the button
and the value of the temperature into 2 variables “STATUSon” and “Temp”
respectively.
 We want to create a variable „Alarm‟ which is 1 if the button is pressed and
the temperature exceeds the nominal temperature „Nominal‟ by 5.
 The expression used to compute such variable is:
Eng.Ahmed Farouk 01026409833

Más contenido relacionado

La actualidad más candente

Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabBilawalBaloch1
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLABSarah Hussein
 
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 introduction lecture 1
Matlab introduction lecture 1Matlab introduction lecture 1
Matlab introduction lecture 1Mohamed Awni
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabSantosh V
 
application based Presentation on matlab simulink & related tools
application based Presentation on matlab simulink & related toolsapplication based Presentation on matlab simulink & related tools
application based Presentation on matlab simulink & related toolsEshaan Verma
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlabaman gupta
 
Matlab from Beginner to Expert
Matlab from Beginner to ExpertMatlab from Beginner to Expert
Matlab from Beginner to Expertsmart-ideas
 
How to work on Matlab.......
How to work on Matlab.......How to work on Matlab.......
How to work on Matlab.......biinoida
 
Matlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IMatlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IVijay Kumar Gupta
 
Matlab day 1: Introduction to MATLAB
Matlab day 1: Introduction to MATLABMatlab day 1: Introduction to MATLAB
Matlab day 1: Introduction to MATLABreddyprasad reddyvari
 
Matlab for diploma students(1)
Matlab for diploma students(1)Matlab for diploma students(1)
Matlab for diploma students(1)Retheesh Raj
 
MATLAB BASICS
MATLAB BASICSMATLAB BASICS
MATLAB BASICSbutest
 
MatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On PlottingMatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On PlottingMOHDRAFIQ22
 
Matlab intro
Matlab introMatlab intro
Matlab introfvijayami
 
Brief Introduction to Matlab
Brief  Introduction to MatlabBrief  Introduction to Matlab
Brief Introduction to MatlabTariq kanher
 

La actualidad más candente (20)

Matlab intro
Matlab introMatlab intro
Matlab intro
 
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
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processing
 
Matlab introduction lecture 1
Matlab introduction lecture 1Matlab introduction lecture 1
Matlab introduction lecture 1
 
MATLAB INTRODUCTION
MATLAB INTRODUCTIONMATLAB INTRODUCTION
MATLAB INTRODUCTION
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
application based Presentation on matlab simulink & related tools
application based Presentation on matlab simulink & related toolsapplication based Presentation on matlab simulink & related tools
application based Presentation on matlab simulink & related tools
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
 
Matlab from Beginner to Expert
Matlab from Beginner to ExpertMatlab from Beginner to Expert
Matlab from Beginner to Expert
 
How to work on Matlab.......
How to work on Matlab.......How to work on Matlab.......
How to work on Matlab.......
 
Matlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IMatlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - I
 
Matlab day 1: Introduction to MATLAB
Matlab day 1: Introduction to MATLABMatlab day 1: Introduction to MATLAB
Matlab day 1: Introduction to MATLAB
 
Matlab for diploma students(1)
Matlab for diploma students(1)Matlab for diploma students(1)
Matlab for diploma students(1)
 
MATLAB BASICS
MATLAB BASICSMATLAB BASICS
MATLAB BASICS
 
MatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On PlottingMatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On Plotting
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
Brief Introduction to Matlab
Brief  Introduction to MatlabBrief  Introduction to Matlab
Brief Introduction to Matlab
 
Matlab basic and image
Matlab basic and imageMatlab basic and image
Matlab basic and image
 

Destacado

mat lab introduction and basics to learn
mat lab introduction and basics to learnmat lab introduction and basics to learn
mat lab introduction and basics to learnpavan373
 
Introduction to programming using mat lab
Introduction to programming using mat labIntroduction to programming using mat lab
Introduction to programming using mat labMOOCS_FacebookPage
 
CIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkCIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkTUOS-Sam
 
Variables in matlab
Variables in matlabVariables in matlab
Variables in matlabTUOS-Sam
 
R Programming: Numeric Functions In R
R Programming: Numeric Functions In RR Programming: Numeric Functions In R
R Programming: Numeric Functions In RRsquared Academy
 
metode numerik stepest descent dengan rerata aritmatika
metode numerik stepest descent dengan rerata aritmatikametode numerik stepest descent dengan rerata aritmatika
metode numerik stepest descent dengan rerata aritmatikaSabarinsyah Piliang
 
Introduction to Matlab Scripts
Introduction to Matlab ScriptsIntroduction to Matlab Scripts
Introduction to Matlab ScriptsShameer Ahmed Koya
 
SSS RESUME_3
SSS RESUME_3SSS RESUME_3
SSS RESUME_3sai Sajja
 
Loops in matlab
Loops in matlabLoops in matlab
Loops in matlabTUOS-Sam
 
Modul1 metode bagi dua Praktikum Metode Numerik
Modul1 metode bagi dua Praktikum Metode NumerikModul1 metode bagi dua Praktikum Metode Numerik
Modul1 metode bagi dua Praktikum Metode NumerikJames Montolalu
 
Modul2 metode regula falsi praktikum metode numerik
Modul2 metode regula falsi praktikum metode numerikModul2 metode regula falsi praktikum metode numerik
Modul2 metode regula falsi praktikum metode numerikJames Montolalu
 
User defined Functions in MATLAB Part 1
User defined Functions in MATLAB Part 1User defined Functions in MATLAB Part 1
User defined Functions in MATLAB Part 1Shameer Ahmed Koya
 
User Defined Functions in MATLAB Part-4
User Defined Functions in MATLAB Part-4User Defined Functions in MATLAB Part-4
User Defined Functions in MATLAB Part-4Shameer Ahmed Koya
 
Metode numerik-buku-ajar-unila
Metode numerik-buku-ajar-unilaMetode numerik-buku-ajar-unila
Metode numerik-buku-ajar-unilaIbad Ahmad
 
Transparency & Meltability in Hot Process Soap - A Guide for Making your own ...
Transparency & Meltability in Hot Process Soap - A Guide for Making your own ...Transparency & Meltability in Hot Process Soap - A Guide for Making your own ...
Transparency & Meltability in Hot Process Soap - A Guide for Making your own ...v2zq
 
Band Combination of Landsat 8 Earth-observing Satellite Images
Band Combination of Landsat 8 Earth-observing Satellite ImagesBand Combination of Landsat 8 Earth-observing Satellite Images
Band Combination of Landsat 8 Earth-observing Satellite ImagesKabir Uddin
 

Destacado (20)

mat lab introduction and basics to learn
mat lab introduction and basics to learnmat lab introduction and basics to learn
mat lab introduction and basics to learn
 
Introduction to programming using mat lab
Introduction to programming using mat labIntroduction to programming using mat lab
Introduction to programming using mat lab
 
CIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkCIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & Coursework
 
Variables in matlab
Variables in matlabVariables in matlab
Variables in matlab
 
R Programming: Numeric Functions In R
R Programming: Numeric Functions In RR Programming: Numeric Functions In R
R Programming: Numeric Functions In R
 
Matlab time series example
Matlab time series exampleMatlab time series example
Matlab time series example
 
metode numerik stepest descent dengan rerata aritmatika
metode numerik stepest descent dengan rerata aritmatikametode numerik stepest descent dengan rerata aritmatika
metode numerik stepest descent dengan rerata aritmatika
 
Introduction to Matlab Scripts
Introduction to Matlab ScriptsIntroduction to Matlab Scripts
Introduction to Matlab Scripts
 
SSS RESUME_3
SSS RESUME_3SSS RESUME_3
SSS RESUME_3
 
Loops in matlab
Loops in matlabLoops in matlab
Loops in matlab
 
Modul1 metode bagi dua Praktikum Metode Numerik
Modul1 metode bagi dua Praktikum Metode NumerikModul1 metode bagi dua Praktikum Metode Numerik
Modul1 metode bagi dua Praktikum Metode Numerik
 
Modul2 metode regula falsi praktikum metode numerik
Modul2 metode regula falsi praktikum metode numerikModul2 metode regula falsi praktikum metode numerik
Modul2 metode regula falsi praktikum metode numerik
 
User defined Functions in MATLAB Part 1
User defined Functions in MATLAB Part 1User defined Functions in MATLAB Part 1
User defined Functions in MATLAB Part 1
 
Fungsi grafik di matlab
Fungsi grafik di matlabFungsi grafik di matlab
Fungsi grafik di matlab
 
User Defined Functions in MATLAB Part-4
User Defined Functions in MATLAB Part-4User Defined Functions in MATLAB Part-4
User Defined Functions in MATLAB Part-4
 
C programming
C programmingC programming
C programming
 
Mat Lab
Mat LabMat Lab
Mat Lab
 
Metode numerik-buku-ajar-unila
Metode numerik-buku-ajar-unilaMetode numerik-buku-ajar-unila
Metode numerik-buku-ajar-unila
 
Transparency & Meltability in Hot Process Soap - A Guide for Making your own ...
Transparency & Meltability in Hot Process Soap - A Guide for Making your own ...Transparency & Meltability in Hot Process Soap - A Guide for Making your own ...
Transparency & Meltability in Hot Process Soap - A Guide for Making your own ...
 
Band Combination of Landsat 8 Earth-observing Satellite Images
Band Combination of Landsat 8 Earth-observing Satellite ImagesBand Combination of Landsat 8 Earth-observing Satellite Images
Band Combination of Landsat 8 Earth-observing Satellite Images
 

Similar a Matlab 1 level_1

Similar a Matlab 1 level_1 (20)

Introduction to Matlab for Engineering Students.pdf
Introduction to Matlab for Engineering Students.pdfIntroduction to Matlab for Engineering Students.pdf
Introduction to Matlab for Engineering Students.pdf
 
Matlab tut2
Matlab tut2Matlab tut2
Matlab tut2
 
interfacing matlab with embedded systems
interfacing matlab with embedded systemsinterfacing matlab with embedded systems
interfacing matlab with embedded systems
 
Mmc manual
Mmc manualMmc manual
Mmc manual
 
Matlab summary
Matlab summaryMatlab summary
Matlab summary
 
EE6711 Power System Simulation Lab manual
EE6711 Power System Simulation Lab manualEE6711 Power System Simulation Lab manual
EE6711 Power System Simulation Lab manual
 
Basic matlab for beginners
Basic matlab for beginnersBasic matlab for beginners
Basic matlab for beginners
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
MATLAB Basics-Part1
MATLAB Basics-Part1MATLAB Basics-Part1
MATLAB Basics-Part1
 
MATLAB guide
MATLAB guideMATLAB guide
MATLAB guide
 
matlabchapter1.ppt
matlabchapter1.pptmatlabchapter1.ppt
matlabchapter1.ppt
 
Matlab guide
Matlab guideMatlab guide
Matlab guide
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
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
 
Ch1
Ch1Ch1
Ch1
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
 
Palm m3 chapter1b
Palm m3 chapter1bPalm m3 chapter1b
Palm m3 chapter1b
 
++Matlab 14 sesiones
++Matlab 14 sesiones++Matlab 14 sesiones
++Matlab 14 sesiones
 
Programming Environment in Matlab
Programming Environment in MatlabProgramming Environment in Matlab
Programming Environment in Matlab
 

Último

Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
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
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 

Último (20)

Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
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
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
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🔝
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 

Matlab 1 level_1

  • 2. Session 1 Content  What is Matlab ?  Introducing the Matlab Development Environment  Performing Basic Arithmetic,  Performing Logical and Relational Operations Eng.Ahmed Farouk 01026409833
  • 3. What is Matlab?  The name Matlab stands for matrix laboratory.  It is a high-performance language for technical computing.  Matlab can deal with Modeling ,simulation , Data analysis , Scientific and engineering graphics,…….  Matlab can deal with sounds, images ,text, excel data,…… .  Matlab is an interactive system whose basic data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with matrix and vector formulations, in a fraction of the time it would take to write a program in a scalar non-interactive language such as C or Fortran. Eng.Ahmed Farouk 01026409833
  • 4. Introducing the Matlab Development Environment If you happen to get employed in a new place, the first thing you would probably do is to take a brief tour to experience your new workplace and its subdivisions, or what we alternatively refer to by the term “Development Environment”. For someone working in a factory, the development environment refers to the work place with all its subdivisions and all the resources and tools it contains. For Matlab users, the development environment refers similarly to the Matlab window and all the resources and tools it contains. The first step in understanding how Matlab works is to experience its development environment. Eng.Ahmed Farouk 01026409833
  • 5.  When you start Matlab, the figure on the next page depicts what you will see. Eng.Ahmed Farouk 01026409833
  • 7. The Command Window  The command window is an interpreter where you can write and execute instructions one at a time or few at a time.  You know where to write your next instruction from the „>>‟ mark, which is called the command prompt. The Workspace Browser  The workspace is the group of variables (arrays) you are working with.  The workspace browser provides you with an overview of the workspace, meaning that it shows you the variable you have created so far.  It shows you the variable name, size, data type and its value if the value is compact enough to be displayed, such as that of a single number or few characters.  By double clicking on any variable, you get to inspect this variable in detail. Eng.Ahmed Farouk 01026409833
  • 8. The Command History  It is an archive of commands previously executed in the command window. You may use it to retrieve and re-execute previous commands.  The command window doesn‟t log your commands from the day you first opened Matlab; it has a maximum buffer size.  Once reached, any new command will append to the bottom of the buffer, causing the topmost command to be lost.  By setting the buffer size to 10,000 for instance, you can make the command window “remember” your last 10,000 commands. Eng.Ahmed Farouk 01026409833
  • 9. The Current Directory  Below the workspace, you can see a tab selection that lets you select either the workspace or the current directory to view.  Click on the “Current Directory” tab.  The current directory is a folder you choose to be your default working folder.  Whenever Matlab requires a user file, it will start its search by looking into this folder.  Whenever Matlab needs to save a user file, it will save it in this folder by default. Eng.Ahmed Farouk 01026409833
  • 10. The rest of the elements of the development environment do not appear at startup by default, but you can call them whenever you need them. We continue our discussion of the development environment by looking at the rest of its elements like:  The Array Editor.  The M-File Editor.  The Figure Window.  The GUI Development Environment (GUIDE).  Simulink. Eng.Ahmed Farouk 01026409833
  • 11. The Array Editor  The array editor is a window that opens to show you the contents of a variable (array) and possibly make you change these contents.  The array editor opens when you double click on a variable in the workspace browser.  The figure below shows an instant of the array editor opened to show us variable “ImA”, a matrix resulting from loading an image into the workspace.
  • 12. The M-File Editor  The M-File Editor is a text-entry window where you can write down complete programs.  The following figure depicts the M-File editor.  You can start the M-File editor by typing edit at the command prompt (>>edit) or by clicking the New M-File button on the startup screen.  The M-File editor contains facilities for writing, debugging and running your programs. Eng.Ahmed Farouk 01026409833
  • 13. The Figure Window  A figure window is a window used with graphics.  A graphic cannot be displayed in the command window.  Therefore it opens in a separate window equipped with facilities for handling graphic, which is the figure window.
  • 14. The GUI Development Environment(GUIDE)  The GUIDE is a tool for building GUIs like the one shown above.  The GUIDE may be started by typing guide at the command prompt (>>guide) or by going to New -> GUI in the Matlab File menu.  The development environment for GUIs will then open. The GUI tool looks as depicted in the figure below.
  • 15. Simulink  Simulink is a Matlab-associated package used for system design, modeling and system analysis.  The figure below shows an example of a house thermodynamic subsystem designed using Simulink. Eng.Ahmed Farouk 01026409833
  • 16. Basic Arithmetic, Relational and Logical Operations Eng.Ahmed Farouk 01026409833
  • 17. Basic Arithmetic, Relational and Logical Operations  Matlab always starts by evaluating the right-hand-side (RHS) of the expression, which is (2 + 3).  This operation evaluates to (5).  So Matlab will try to assign the value 5 to the left-hand-side (LHS), which is (E).  However, the variable (E) does not exist yet, so Matlab will create a variable called (E) then carry out the assignment.  Hence the result of this expression is that E equals 5. Eng.Ahmed Farouk 01026409833
  • 18. Basic Arithmetic, Relational and Logical Operations Note:  If the variable E already existed, its previous contents will be replaced by the result of evaluating the new expression.  If the expression contains an operation without a LHS variable to which the result may be assigned, Matlab automatically uses a default variable called “ans‟ standing for “answer”. To try this, write (>> 2+3).  If you append any expression by a semicolon (;), the expression will be evaluated normally, but the output of its evaluation won’t be reported in the command prompt. Eng.Ahmed Farouk 01026409833
  • 19. Arithmetic Operations  The following table shows a list of the available arithmetic operations and their description. Eng.Ahmed Farouk 01026409833
  • 20. Logical Operations  In arithmetic operations, the operands may have any numerical values.  In logical operations, the operands may have one of two values: either nonzero or zero (also called true or false).  In input operands, 0 is used to indicate (logic 0), while any number other than 0 may be used to indicate (logic 1).  In the results of a logical operation, a 0 is always used to indicate (logic 0) while a 1 is always used to indicate (logic 1). Eng.Ahmed Farouk 01026409833
  • 21. Logical Operations Note:  Other logical operations such as NANDing, NORing and XNORing may be performed by combining two or more of the previous operators.  Example: c=~(A|B) is equivalent to NORing A with B then assigning the result to c. Logic 0 is also referred to as „False‟, and logic 1 is also referred to as „True‟. Examples:  >>a=-5;b=2;c=0;  >>x=a & b ;  %x=1  >>y=c & b ;  %y=0  >>z=c | b ;  %z=1  >>w=~b ;  %w=0 Note:  You can get up to the previous commands by using the up and down arrows.
  • 22. Relational Tests  Relational operations are simple in their concept. A relational operation is a test done on a certain expression. Hence, they are also called relational tests.  The test evaluates to (Logic 1) if the expression is true and evaluates to (Logic 0) if the expression is false. Eng.Ahmed Farouk 01026409833
  • 23. Relational Tests Examples:  >>a=5;b=2;  >>x=a>b;  %x=1  >>x=(a~=b)  %x=1 Note:  Many users confuse the double equality sign (==) used in relational tests with the equality sign (=) used in assignments.  When a user uses (=) instead of (==), Matlab usually reports that an expected relational operator wasn’t found. Eng.Ahmed Farouk 01026409833
  • 24. Combining Different Operations  Let us assume that we want to operate an alarm mechanism if an “automatic temperature alarm” button is pressed and the room temperature exceeds the nominal by 5 degrees.  The status of the “automatic temperature alarm” button is 0 if the button is not pressed and is 1 if the button is pressed.  The temperature is read by a sensor.  We may use Matlab interfacing techniques to read the status of the button and the value of the temperature into 2 variables “STATUSon” and “Temp” respectively.  We want to create a variable „Alarm‟ which is 1 if the button is pressed and the temperature exceeds the nominal temperature „Nominal‟ by 5.  The expression used to compute such variable is: Eng.Ahmed Farouk 01026409833