SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

Matlab intro
Matlab introMatlab intro
Matlab intro
Chaitanya Banoth
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
Vikash Jakhar
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
BilawalBaloch1
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
Sarah Hussein
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processing
Dr. Manjunatha. P
 
Matlab introduction lecture 1
Matlab introduction lecture 1Matlab introduction lecture 1
Matlab introduction lecture 1
Mohamed Awni
 
MATLAB INTRODUCTION
MATLAB INTRODUCTIONMATLAB INTRODUCTION
MATLAB INTRODUCTION
Dr. Krishna Mohbey
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
Santosh 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 tools
Eshaan Verma
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
aman gupta
 
Matlab from Beginner to Expert
Matlab from Beginner to ExpertMatlab from Beginner to Expert
Matlab from Beginner to Expert
smart-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 - I
Vijay Kumar Gupta
 
Matlab day 1: Introduction to MATLAB
Matlab day 1: Introduction to MATLABMatlab day 1: Introduction to MATLAB
Matlab day 1: Introduction to MATLAB
reddyprasad 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 BASICS
butest
 
MatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On PlottingMatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On Plotting
MOHDRAFIQ22
 
Matlab intro
Matlab introMatlab intro
Matlab intro
fvijayami
 
Brief Introduction to Matlab
Brief  Introduction to MatlabBrief  Introduction to Matlab
Brief Introduction to Matlab
Tariq kanher
 
Matlab basic and image
Matlab basic and imageMatlab basic and image
Matlab basic and image
Divyanshu Rasauria
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
BilawalBaloch1
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
Sarah Hussein
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processing
Dr. Manjunatha. P
 
Matlab introduction lecture 1
Matlab introduction lecture 1Matlab introduction lecture 1
Matlab introduction lecture 1
Mohamed Awni
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
Santosh 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 tools
Eshaan Verma
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
aman gupta
 
Matlab from Beginner to Expert
Matlab from Beginner to ExpertMatlab from Beginner to Expert
Matlab from Beginner to Expert
smart-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 - I
Vijay Kumar Gupta
 
Matlab day 1: Introduction to MATLAB
Matlab day 1: Introduction to MATLABMatlab day 1: Introduction to MATLAB
Matlab day 1: Introduction to MATLAB
reddyprasad 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 BASICS
butest
 
MatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On PlottingMatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On Plotting
MOHDRAFIQ22
 
Matlab intro
Matlab introMatlab intro
Matlab intro
fvijayami
 
Brief Introduction to Matlab
Brief  Introduction to MatlabBrief  Introduction to Matlab
Brief Introduction to Matlab
Tariq kanher
 

Viewers also liked (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
pavan373
 
Introduction to programming using mat lab
Introduction to programming using mat labIntroduction to programming using mat lab
Introduction to programming using mat lab
MOOCS_FacebookPage
 
CIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkCIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & Coursework
TUOS-Sam
 
Variables in matlab
Variables in matlabVariables in matlab
Variables in matlab
TUOS-Sam
 
R Programming: Numeric Functions In R
R Programming: Numeric Functions In RR Programming: Numeric Functions In R
R Programming: Numeric Functions In R
Rsquared Academy
 
Matlab time series example
Matlab time series exampleMatlab time series example
Matlab time series example
Ovie Uddin Ovie Uddin
 
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
Sabarinsyah Piliang
 
Introduction to Matlab Scripts
Introduction to Matlab ScriptsIntroduction to Matlab Scripts
Introduction to Matlab Scripts
Shameer Ahmed Koya
 
SSS RESUME_3
SSS RESUME_3SSS RESUME_3
SSS RESUME_3
sai Sajja
 
Loops in matlab
Loops in matlabLoops in matlab
Loops in matlab
TUOS-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 Numerik
James 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 numerik
James 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 1
Shameer 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-4
Shameer Ahmed Koya
 
C programming
C programmingC programming
C programming
Envision Computer Training Institute
 
Mat Lab
Mat LabMat Lab
Mat Lab
Nina Tvenge
 
Metode numerik-buku-ajar-unila
Metode numerik-buku-ajar-unilaMetode numerik-buku-ajar-unila
Metode numerik-buku-ajar-unila
Ibad 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 Images
Kabir Uddin
 
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
pavan373
 
Introduction to programming using mat lab
Introduction to programming using mat labIntroduction to programming using mat lab
Introduction to programming using mat lab
MOOCS_FacebookPage
 
CIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkCIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & Coursework
TUOS-Sam
 
Variables in matlab
Variables in matlabVariables in matlab
Variables in matlab
TUOS-Sam
 
R Programming: Numeric Functions In R
R Programming: Numeric Functions In RR Programming: Numeric Functions In R
R Programming: Numeric Functions In R
Rsquared 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 aritmatika
Sabarinsyah Piliang
 
Introduction to Matlab Scripts
Introduction to Matlab ScriptsIntroduction to Matlab Scripts
Introduction to Matlab Scripts
Shameer Ahmed Koya
 
SSS RESUME_3
SSS RESUME_3SSS RESUME_3
SSS RESUME_3
sai Sajja
 
Loops in matlab
Loops in matlabLoops in matlab
Loops in matlab
TUOS-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 Numerik
James 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 numerik
James 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 1
Shameer 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-4
Shameer Ahmed Koya
 
Metode numerik-buku-ajar-unila
Metode numerik-buku-ajar-unilaMetode numerik-buku-ajar-unila
Metode numerik-buku-ajar-unila
Ibad 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 Images
Kabir Uddin
 
Ad

Similar to Matlab 1 level_1 (20)

Introduction to Matlab for Engineering & Science Students.pdf
Introduction to Matlab for Engineering & Science Students.pdfIntroduction to Matlab for Engineering & Science Students.pdf
Introduction to Matlab for Engineering & Science Students.pdf
Dr Azizul Hasan
 
Matlab tut2
Matlab tut2Matlab tut2
Matlab tut2
Vinnu Vinay
 
interfacing matlab with embedded systems
interfacing matlab with embedded systemsinterfacing matlab with embedded systems
interfacing matlab with embedded systems
Raghav Shetty
 
Mmc manual
Mmc manualMmc manual
Mmc manual
Urvi Surat
 
Matlab summary
Matlab summaryMatlab summary
Matlab summary
Vinnu Vinay
 
EE6711 Power System Simulation Lab manual
EE6711 Power System Simulation Lab manualEE6711 Power System Simulation Lab manual
EE6711 Power System Simulation Lab manual
Velalar College of Engineering and Technology
 
Basic matlab for beginners
Basic matlab for beginnersBasic matlab for beginners
Basic matlab for beginners
Kwabena Owusu-Agyemang
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
Indrani Jangete
 
MATLAB Basics-Part1
MATLAB Basics-Part1MATLAB Basics-Part1
MATLAB Basics-Part1
Elaf A.Saeed
 
MATLAB guide
MATLAB guideMATLAB guide
MATLAB guide
Prerna Rathore
 
matlabchapter1.ppt
matlabchapter1.pptmatlabchapter1.ppt
matlabchapter1.ppt
PariaMotahari1
 
Matlab guide
Matlab guideMatlab guide
Matlab guide
aibad ahmed
 
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
amanabr
 
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
Kurmendra Singh
 
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
MahuaPal6
 
Ch1
Ch1Ch1
Ch1
Emkei Sario
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
Indra Hermawan
 
Palm m3 chapter1b
Palm m3 chapter1bPalm m3 chapter1b
Palm m3 chapter1b
Juan Pablo Fuentes Encinas
 
++Matlab 14 sesiones
++Matlab 14 sesiones++Matlab 14 sesiones
++Matlab 14 sesiones
Rosemberth Rodriguez
 
Programming Environment in Matlab
Programming Environment in MatlabProgramming Environment in Matlab
Programming Environment in Matlab
DataminingTools Inc
 
Ad

Recently uploaded (20)

introduction technology technology tec.pptx
introduction technology technology tec.pptxintroduction technology technology tec.pptx
introduction technology technology tec.pptx
Iftikhar70
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Journal of Soft Computing in Civil Engineering
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
Machine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATIONMachine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATION
DarrinBright1
 
Modeling the Influence of Environmental Factors on Concrete Evaporation Rate
Modeling the Influence of Environmental Factors on Concrete Evaporation RateModeling the Influence of Environmental Factors on Concrete Evaporation Rate
Modeling the Influence of Environmental Factors on Concrete Evaporation Rate
Journal of Soft Computing in Civil Engineering
 
IBAAS 2023 Series_Lecture 8- Dr. Nandi.pdf
IBAAS 2023 Series_Lecture 8- Dr. Nandi.pdfIBAAS 2023 Series_Lecture 8- Dr. Nandi.pdf
IBAAS 2023 Series_Lecture 8- Dr. Nandi.pdf
VigneshPalaniappanM
 
[PyCon US 2025] Scaling the Mountain_ A Framework for Tackling Large-Scale Te...
[PyCon US 2025] Scaling the Mountain_ A Framework for Tackling Large-Scale Te...[PyCon US 2025] Scaling the Mountain_ A Framework for Tackling Large-Scale Te...
[PyCon US 2025] Scaling the Mountain_ A Framework for Tackling Large-Scale Te...
Jimmy Lai
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Environment .................................
Environment .................................Environment .................................
Environment .................................
shadyozq9
 
🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...
🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...
🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...
SanjeetMishra29
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
PPT on Sattelite satellite & Radar(1).pptx
PPT on Sattelite satellite & Radar(1).pptxPPT on Sattelite satellite & Radar(1).pptx
PPT on Sattelite satellite & Radar(1).pptx
navneet19791
 
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
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
AI-Powered Data Management and Governance in Retail
AI-Powered Data Management and Governance in RetailAI-Powered Data Management and Governance in Retail
AI-Powered Data Management and Governance in Retail
IJDKP
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Deepfake Phishing: A New Frontier in Cyber Threats
Deepfake Phishing: A New Frontier in Cyber ThreatsDeepfake Phishing: A New Frontier in Cyber Threats
Deepfake Phishing: A New Frontier in Cyber Threats
RaviKumar256934
 
introduction technology technology tec.pptx
introduction technology technology tec.pptxintroduction technology technology tec.pptx
introduction technology technology tec.pptx
Iftikhar70
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
Machine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATIONMachine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATION
DarrinBright1
 
IBAAS 2023 Series_Lecture 8- Dr. Nandi.pdf
IBAAS 2023 Series_Lecture 8- Dr. Nandi.pdfIBAAS 2023 Series_Lecture 8- Dr. Nandi.pdf
IBAAS 2023 Series_Lecture 8- Dr. Nandi.pdf
VigneshPalaniappanM
 
[PyCon US 2025] Scaling the Mountain_ A Framework for Tackling Large-Scale Te...
[PyCon US 2025] Scaling the Mountain_ A Framework for Tackling Large-Scale Te...[PyCon US 2025] Scaling the Mountain_ A Framework for Tackling Large-Scale Te...
[PyCon US 2025] Scaling the Mountain_ A Framework for Tackling Large-Scale Te...
Jimmy Lai
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Environment .................................
Environment .................................Environment .................................
Environment .................................
shadyozq9
 
🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...
🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...
🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...
SanjeetMishra29
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
PPT on Sattelite satellite & Radar(1).pptx
PPT on Sattelite satellite & Radar(1).pptxPPT on Sattelite satellite & Radar(1).pptx
PPT on Sattelite satellite & Radar(1).pptx
navneet19791
 
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
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
AI-Powered Data Management and Governance in Retail
AI-Powered Data Management and Governance in RetailAI-Powered Data Management and Governance in Retail
AI-Powered Data Management and Governance in Retail
IJDKP
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Deepfake Phishing: A New Frontier in Cyber Threats
Deepfake Phishing: A New Frontier in Cyber ThreatsDeepfake Phishing: A New Frontier in Cyber Threats
Deepfake Phishing: A New Frontier in Cyber Threats
RaviKumar256934
 

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
  翻译: