“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
MATLAB.pptx
1.
2. ⚫MATLAB Stands for MATrix LABoratory
⚫Created by Cleve Moler @ Stanford U. in 1970
⚫Why? Makes linearalgebra, numerical analysis and
optimization a lot easier
⚫MATLAB is a dynamically typed language
⚫Means thatyou do not have todeclare any variables
⚫All you need todo is initializethem and theyarecreated
⚫MATLAB treatsall variablesas matrices
⚫Scalar – 1 x 1 matrix. Vector – 1 x N or N x 1 matrix
3. Intro to Digital Images
Digital Image
agrid of squares,
each of which
containsa single
color
each square is
called apixel (or
picture element)
Color images have 3 values per pixel;
monochrome / grayscale images = 1
value/pixel.
4. Intro to Digital Images
12
blue 61
red
I ( p) green 43
p r,c
row # , col #
272, 277
Pixel : [ p, I(p)]
Pixel Location: p = (r , c)
Pixel Value: I(p) = I(r , c)
5.
6. A. Command window
This is the window which opens first when
MATLAB is started, it runs the programs by
entering variables.
7. Figure Window
When we execute graphic commands the
figure window opens up automatically. It
contains graphs which is being created by
these commands.
8. Editor window
In order to open the editor window we have to click the file menu in the
command window. It is mainly used for writing and editing programs in
MATLAB. Editor window is used for creation and debugging the script and
function files.
9. Help window
The help window can be opened up while working in any MATLAB window by
clicking the help menu. It is mainly used for taking guidance of any features of
MATLAB.
12. R/W Images in MATLAB
⚫Sowe havean image file… how do I access the info?
⚫Open up MATLAB and changeworking directory to
where image is stored
⚫Use the imread() function
⚫im = imread(‘name_of_image.ext’)
⚫Usesinglequotes, and type in the full nameof the image
with its extension (.bmp, .jpg, etc.)
⚫im will contain a 2D matrix (rows x cols) of B&W values
ora 3D matrix (rows x cols x 3) of colourvalues
⚫Matrixcorresponds toeach pixel in thedigital image for
B & W, oracolourcomponent of a pixel in colour