SlideShare uma empresa Scribd logo
1 de 39
CIV 1900
Computer programming
Contents for Lecture 5
• Plotting capabilities in Matlab
• Digital images and their construction
• Image processing
Matlab offers a rich graphics
environment and even if you do not
feel comfortable programming in
Matlab you should make use of its
graphics capabilities as it will allow
you to produce much higher quality
graphs and figures than is possible
in Excel, for example.
Pressure on the rib and in its lee
Turbulent kinetic energy
The most basic function you can use is to
generate scatterplots.
Imagine that you have an array of data where the
first column contains the year (1985-2010) in
which a sample was taken and the second is
some property of that sample.
A basic piece of exploratory data analysis would
be to plot these data against one another.
The Matlab command is “plot”
i.e.
plot(Data(:,1),Data(:,2))
This defaults to producing a solid line in blue
plot(Data(:,1),Data(:,2))


We can make use of a shorthand for line symbols,
line colours and line types to vary this. Some
examples:
Colours           Types               Symbols
b = blue          - = solid line      o = circles
r = red           : = dotted          s = square
k = black         -- = dashed         d = diamond
g = green                             ^ = triangle
Plot(Data(:,1),Data(:,2),‟:ok‟)
Plot(Data(:,1),Data(:,2),‟--^g‟,‟linewidth‟,2)
We can improve the look of our plots by editing
the axis properties.



                 Click Here
Here I have edited the text size and the upper limit
of the x-axis.
Here I have defined the y-axis with a mathematical
expression (you can‟t do this in Excel)
Here I have converted the axes to log axes
figure
plot (Data(:,1),Data(:,2),':^m','linewidth',1.5)
hold on
plot (Data(:,1),Data(:,3),„--m','linewidth',1.5)
figure
subplot(1,3,1:2)
plot (Data(:,1),Data(:,2),':^m','linewidth',1.5)
subplot(1,3,3)
plot (Data(:,1),Data(:,3),„--m','linewidth',1.5)
A 3D line plot:
figure
plot3(Data(:,1),Data(:,2),Data(:,3),‟k‟,‟linewidth‟,2)
If we have an array of data we can plot it as a surface,
where the x and y axes are given by the size of the array
and the z-axis by the values in the array
If we have an array of data we can plot it
as a surface, where the x and y axes are
given by the size of the array and the z-
axis by the values in the array.
surf(CIV1900_images{4})
We may then rotate this
We may then rotate this
Images may also be displayed using the “image”
or “imagesc” commands.
Hopefully the previous example has highlighted
that an image is simply an array of digital
numbers.
This example was coloured but it was a “false
colour” image. There was only level to the array
and the colouring was applied in bands:
high values (peaks) in red; low values (troughs) in
blue.
It might as well be a grey-scale image and we can
make it so by changing the “colormap”.
surf(CIV1900_images{4})
colormap(„gray‟)
A “true colour” image (like a jpeg file) is
constructed rather differently. Instead of a single
layer to the array, it has layers for each colour:
Three layers for an RGB image
Four for a CMYK image
Each layer ranges from 0 to 255 and tells you how
red or green or blue the colour is at that point.
When they are all combined they give you the
colour at that location, which using a legend, you
can relate to properties of the image.
Colour maps in Matlab by default range from 0 to
63.
The “image” command displays an image literally
relating the values in the array to the colour map.
The “imagesc” command rescales the values in
the array so that they fit the colour map.
For example, the values in our image go from 0-
255 so using “image” we would expect about 75%
of the image to wash out as white
figure
image(CIV1900_images{4})
colormap('gray')
figure
imagesc(CIV1900_images{4})
colormap('gray')
figure
imagesc(CIV1900_images{4})
axis („image‟)
colormap('gray')
figure
for loop1=1:9
        subplot(3,3,loop1)
        imagesc(CIV1900_images{loop1*3+4})
        axis image
        colormap('gray')
end
Matlab provides a flexible tool for producing
graphics.
This includes images, which are simply arrays of
numbers (1 layer for grey-scale, more for true
colour).
Image processing is an important area of
engineering science:
Stress analysis on beams using photostress
systems;
Particle Imaging velocimetry;
Monitoring of land use change using remote
sensing;
Face or fingerprint recognition software, etc.
The Coursework




  Sobel Filtering – Edge Detection
The Coursework




    The convolution integral
The Coursework      Filter




            Image
The Coursework
The Coursework
The Coursework




  Sobel X        Sobel Y

Mais conteúdo relacionado

Mais procurados

Uses of AutoCAD in Engineering
Uses of AutoCAD in EngineeringUses of AutoCAD in Engineering
Uses of AutoCAD in Engineeringjohnysteve
 
Computer Graphics Concepts
Computer Graphics ConceptsComputer Graphics Concepts
Computer Graphics ConceptsSHAKOOR AB
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introductionssuser2797e4
 
Computer Graphics Practical
Computer Graphics PracticalComputer Graphics Practical
Computer Graphics PracticalNeha Sharma
 
Auto cad ppt
Auto cad pptAuto cad ppt
Auto cad ppthrprt7696
 
Computer graphics
Computer graphics Computer graphics
Computer graphics shafiq sangi
 
Computer graphics
Computer graphicsComputer graphics
Computer graphicsamitsarda3
 
Computer graphics practical(jainam)
Computer graphics practical(jainam)Computer graphics practical(jainam)
Computer graphics practical(jainam)JAINAM KAPADIYA
 
my ppt for autocad &autocad electrical
my ppt for autocad &autocad electricalmy ppt for autocad &autocad electrical
my ppt for autocad &autocad electricalh soundarya
 
Lecture 02 visualization and programming
Lecture 02   visualization and programmingLecture 02   visualization and programming
Lecture 02 visualization and programmingSmee Kaem Chann
 
Matlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge DetectionMatlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge DetectionDataminingTools Inc
 
Autocad chapter 4 for mobile use.
Autocad chapter 4 for mobile use.Autocad chapter 4 for mobile use.
Autocad chapter 4 for mobile use.Autocad Mobile
 

Mais procurados (20)

Uses of AutoCAD in Engineering
Uses of AutoCAD in EngineeringUses of AutoCAD in Engineering
Uses of AutoCAD in Engineering
 
Matlab Visualizing Data
Matlab Visualizing DataMatlab Visualizing Data
Matlab Visualizing Data
 
Computer Graphics Concepts
Computer Graphics ConceptsComputer Graphics Concepts
Computer Graphics Concepts
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Computer Graphics Practical
Computer Graphics PracticalComputer Graphics Practical
Computer Graphics Practical
 
Auto cad tutorial
Auto cad tutorialAuto cad tutorial
Auto cad tutorial
 
Auto cad ppt
Auto cad pptAuto cad ppt
Auto cad ppt
 
Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)
 
Cad ppt
Cad pptCad ppt
Cad ppt
 
Auto cad
Auto cadAuto cad
Auto cad
 
Computer graphics
Computer graphics Computer graphics
Computer graphics
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Computer graphics practical(jainam)
Computer graphics practical(jainam)Computer graphics practical(jainam)
Computer graphics practical(jainam)
 
K10947 Vikas ct
K10947 Vikas ctK10947 Vikas ct
K10947 Vikas ct
 
my ppt for autocad &autocad electrical
my ppt for autocad &autocad electricalmy ppt for autocad &autocad electrical
my ppt for autocad &autocad electrical
 
Lecture 02 visualization and programming
Lecture 02   visualization and programmingLecture 02   visualization and programming
Lecture 02 visualization and programming
 
Unit 11. Graphics
Unit 11. GraphicsUnit 11. Graphics
Unit 11. Graphics
 
AutoCAD Architecture
AutoCAD ArchitectureAutoCAD Architecture
AutoCAD Architecture
 
Matlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge DetectionMatlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge Detection
 
Autocad chapter 4 for mobile use.
Autocad chapter 4 for mobile use.Autocad chapter 4 for mobile use.
Autocad chapter 4 for mobile use.
 

Destaque

Loops in matlab
Loops in matlabLoops in matlab
Loops 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
 
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
 
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
 
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
 
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
 
Panduan matlab
Panduan matlabPanduan matlab
Panduan matlabgiya12001
 
Metode numerik persamaan non linier
Metode numerik persamaan non linierMetode numerik persamaan non linier
Metode numerik persamaan non linierIzhan Nassuha
 
Contoh program matlab
Contoh program matlabContoh program matlab
Contoh program matlabZahra Doangs
 
4 Menggambar Grafik Fungsi Dengan Matlab
4 Menggambar Grafik Fungsi Dengan Matlab4 Menggambar Grafik Fungsi Dengan Matlab
4 Menggambar Grafik Fungsi Dengan MatlabSimon Patabang
 

Destaque (20)

Loops in matlab
Loops in matlabLoops in matlab
Loops 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
 
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
 
Metode numerik-buku-ajar-unila
Metode numerik-buku-ajar-unilaMetode numerik-buku-ajar-unila
Metode numerik-buku-ajar-unila
 
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
 
Matlab 1 level_1
Matlab 1 level_1Matlab 1 level_1
Matlab 1 level_1
 
MATLAB Programming - Loop Control Part 2
MATLAB Programming - Loop Control Part 2MATLAB Programming - Loop Control Part 2
MATLAB Programming - Loop Control Part 2
 
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
 
Panduan matlab
Panduan matlabPanduan matlab
Panduan matlab
 
Metode numerik persamaan non linier
Metode numerik persamaan non linierMetode numerik persamaan non linier
Metode numerik persamaan non linier
 
Contoh program matlab
Contoh program matlabContoh program matlab
Contoh program matlab
 
4 Menggambar Grafik Fungsi Dengan Matlab
4 Menggambar Grafik Fungsi Dengan Matlab4 Menggambar Grafik Fungsi Dengan Matlab
4 Menggambar Grafik Fungsi Dengan Matlab
 
R programming
R programmingR programming
R programming
 

Semelhante a CIV1900 Matlab - Plotting & Coursework

Basics of Digital Images
Basics of  Digital ImagesBasics of  Digital Images
Basics of Digital ImagesSaad Al-Momen
 
Chart and graphs in R programming language
Chart and graphs in R programming language Chart and graphs in R programming language
Chart and graphs in R programming language CHANDAN KUMAR
 
Q plot tutorial
Q plot tutorialQ plot tutorial
Q plot tutorialAbhik Seal
 
Matlab intro
Matlab introMatlab intro
Matlab introfvijayami
 
CE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdfCE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdfUmarMustafa13
 
Exploratory data analysis using r
Exploratory data analysis using rExploratory data analysis using r
Exploratory data analysis using rTahera Shaikh
 
1. Introduction.pptx
1. Introduction.pptx1. Introduction.pptx
1. Introduction.pptxSungaleliYuen
 
How to combine interpolation and regression graphs in R
How to combine interpolation and regression graphs in RHow to combine interpolation and regression graphs in R
How to combine interpolation and regression graphs in RDougLoqa
 
statistical computation using R- an intro..
statistical computation using R- an intro..statistical computation using R- an intro..
statistical computation using R- an intro..Kamarudheen KV
 
Me 443 4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
Me 443   4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...Me 443   4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
Me 443 4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...Erdi Karaçal
 
Vision systems_Image processing tool box in MATLAB
Vision systems_Image processing tool box in MATLABVision systems_Image processing tool box in MATLAB
Vision systems_Image processing tool box in MATLABHinna Nayab
 

Semelhante a CIV1900 Matlab - Plotting & Coursework (20)

MATLAB
MATLABMATLAB
MATLAB
 
Basics of Digital Images
Basics of  Digital ImagesBasics of  Digital Images
Basics of Digital Images
 
Chart and graphs in R programming language
Chart and graphs in R programming language Chart and graphs in R programming language
Chart and graphs in R programming language
 
Matlab graphics
Matlab graphicsMatlab graphics
Matlab graphics
 
Q plot tutorial
Q plot tutorialQ plot tutorial
Q plot tutorial
 
Basic Analysis using Python
Basic Analysis using PythonBasic Analysis using Python
Basic Analysis using Python
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
CE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdfCE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdf
 
Exploratory data analysis using r
Exploratory data analysis using rExploratory data analysis using r
Exploratory data analysis using r
 
Lesson 3
Lesson 3Lesson 3
Lesson 3
 
1. Introduction.pptx
1. Introduction.pptx1. Introduction.pptx
1. Introduction.pptx
 
R training5
R training5R training5
R training5
 
Computation Assignment Help
Computation Assignment Help Computation Assignment Help
Computation Assignment Help
 
How to combine interpolation and regression graphs in R
How to combine interpolation and regression graphs in RHow to combine interpolation and regression graphs in R
How to combine interpolation and regression graphs in R
 
statistical computation using R- an intro..
statistical computation using R- an intro..statistical computation using R- an intro..
statistical computation using R- an intro..
 
Me 443 4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
Me 443   4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...Me 443   4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
Me 443 4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
 
Computer Science Assignment Help
Computer Science Assignment Help Computer Science Assignment Help
Computer Science Assignment Help
 
Scilab
Scilab Scilab
Scilab
 
Vision systems_Image processing tool box in MATLAB
Vision systems_Image processing tool box in MATLABVision systems_Image processing tool box in MATLAB
Vision systems_Image processing tool box in MATLAB
 
Matlab1
Matlab1Matlab1
Matlab1
 

CIV1900 Matlab - Plotting & Coursework