Attribution Non-Commercial (BY-NC)

157 views

Attribution Non-Commercial (BY-NC)

- EEM496 Communication Systems Laboratory - Experiment0- Introduction to Matlab, Simulink, And the Communication Toolbox
- 1934015040
- Face Detection System - File Exchange - MATLAB Central
- (Chapman & hall_crc computational science 30) Steven I. Gordon, Brian Guilfoos-Introduction to Modeling and Simulation with MATLAB® and Python-Chapman and Hall_CRC_Taylor & Francis (2017).pdf
- Embedded MATLAB
- Matlab Tutorial
- Introduction to Matlab.ppt
- Comm2_2012
- Mat Lab for Sci Lab Users
- Matlab Notes
- Suspension System
- Introduction to MATLAB
- base
- MATLAB Session 1
- Finance engineering
- matlab_tutorial.pdf
- Module 01
- Matlab documents
- 5892 MATLAB S-Function.pdf
- laporan matlab baru.docx

You are on page 1of 24

Introduction

MatLab : Matrix Laboratory

A high-level language for matrix calculations,

Can type on command line, or use a program file

(m-file) Semicolon at end of line is optional (suppresses printing) Control flow (if, for, while, switch,etc) similar to C Differences from C: no variable declarations, no pointers

MATLABs Workspace

who,whos - current variables in workspace save - save workspace variables to *.mat file load - load variables from *.mat file clear all - clear workspace variables

Matlab Basics

Everything is a matrix a variable is a 1x1 matrix Initializing a matrix: Example: my_matrix = [1 2 3; 4 5 6; 7 8 9]; Accessing a matrix (row, column): my_matrix(1,2) has the value 2

my_matrix = 1 2 3 4 5 6 7 8 9

Colon operator generates a range Example: 1:10 = [1 2 3 4 5 6 7 8 9 10] mytest(1, 2:4) is equivalent to mytest(1,[2 3 4]) mytest(3, :) refers to all elements of row 3

All the operators in MATLAB defined on

matrices : +, -, *, /, ^, sqrt, sin, cos etc. Element wise operators defined with preceding dot : .*, ./, .^ . size(A) - size vector sum(A) - columns sums vector sum(sum(A)) - all the elements sum

Logical Conditions

(not)~

find(condition) - Returns indexes

of As elements that satisfies the condition.

Logical Conditions(cont.)

Example:

>> A = [1 2; 3 4], I = find(A<4) A= 1 3 2 4

I= 1 2 3

Flow Control

if

Scripts,

which do not accept input arguments or return output arguments. They operate on data in the workspace. which can accept input arguments and return output arguments. Internal variables are local to the function.

Functions,

plot(x,y), plot(x,sin(x)) - plot 1-D

function figure , figure(k) - open a new figure hold on, hold off - refreshing mesh(x_ax,y_ax,z_mat) - view surface contour(z_mat) - view z as top. map subplot(3,1,2) - locate several plots in figure axis([xmin xmax ymin ymax]) change axes title(figure title) - add title to figure

The Image Processing Toolbox is a collection of

functions that extend the capability of the MATLAB numeric computing environment. The toolbox supports a wide range of image processing operations, including:

Geometric operations Neighborhood and block operations Linear filtering and filter design Transforms Image analysis and enhancement Binary image operations

Indexed images Intensity images Binary images RGB images

: : : :

I = imread(colors.jpg');

[x,map] = imread(color.png'); imwrite(I, newim.jpg)

Image Display

image

- create and display image object imagesc - scale and display as image imshow - display image colorbar - display colorbar getimage- get image data from axes truesize - adjust display size of image zoom - zoom in and zoom out of 2D plot

Image Conversion

gray2ind - intensity image to index image im2bw

- image to binary im2double - image to double precision im2uint8 - image to 8-bit unsigned integers im2uint16 - image to 16-bit unsigned integers ind2gray - indexed image to intensity image mat2gray - matrix to intensity image rgb2gray - RGB image to grayscale rgb2ind - RGB image to indexed image

Geometric Operations

Image resizing: imresize(I,[x y],method). Method is bilinear, bicubic or nearest neighbours. Image rotation: imrotate(I,angle,method) method is same as before. Zero padding in the rotated image. Image cropping: J=imcrop;

Neighbourhood Processing

To speed up neighbourhood processing

The borders are usually padded with zeros for

the computations of the edges neighborhoods. Linear filtering can be done with convolution - conv2(Img, h) or correlation - filter2(Img, h). Nonlinear filtering: nlfilter(I,[sx sy],func) where func is a function that recieves the windows and returns scalars.

17

Transforms

Fourier and inverse Fourier transform:

DCT and compression

I=imread(cameraman.tif); I=im2double(I); T=dctmtx(8); B=blkproc(I,[8 8], P1*x*P2,T,T); mask=[1 1 1 0 0 ]; B2=blkproc(B,[8 8],P1*x,mask); I2=blkproc(B2,[8 8],P1*x*P2,T,T); It is also possible to use dct2 and idct2.

18

pixval returns the value of a pointed pixel and the distance between two pointed pixels. impixel returns the data value for a selected set of pixels. The set can be pointed by the mouse or by coordinates. imcontour plots the contours of the image. imhist(I,n) plots the histogram of I with n bins.

19

Edge detection:

Image Enhancement:

Histogram stretching:

imadjust(I,[low high],[bottom top]);

Gamma correction:

imadjust(I,[],[],gamma_coef);

Histogram Equalization

histeq(I)

20

Noise removal

To add noise to an image: imnoise(I,type,coef); type can be salt n pepper, speckle, gaussian for S&P, multiplicative and additive noise. Averaging or gaussian filtering: F=filter2(fspecial(average,3),J); Median filtering: F=medfilt(J,[3 3]);

21

Morphological Operations

Dilation : imdilate() Erosion: imerode() Closing: imclose() Opening: imopen()

22

The available colorspaces: RGB, NTSC (US televisions), YCbCr (Digital video), HSV. Transformations between the spaces: rgb2ntsc, hsv2rgb,

Color

23

Questions?

- EEM496 Communication Systems Laboratory - Experiment0- Introduction to Matlab, Simulink, And the Communication ToolboxUploaded bydonatello84
- 1934015040Uploaded byOscar Trujillo Rodriguez
- Face Detection System - File Exchange - MATLAB CentralUploaded byPollen Ahmed
- (Chapman & hall_crc computational science 30) Steven I. Gordon, Brian Guilfoos-Introduction to Modeling and Simulation with MATLAB® and Python-Chapman and Hall_CRC_Taylor & Francis (2017).pdfUploaded byNarayana Rao
- Embedded MATLABUploaded bye2matrix
- Matlab TutorialUploaded byjudith matienzo
- Introduction to Matlab.pptUploaded byJithendra Nath
- Comm2_2012Uploaded byDr-Raghad Al-Faham
- Mat Lab for Sci Lab UsersUploaded byDeepank Ch
- Matlab NotesUploaded byjagadeesh jagade
- Suspension SystemUploaded byAbqori Aula
- Introduction to MATLABUploaded byAbdullah Ansari
- baseUploaded byPeniru Edo
- MATLAB Session 1Uploaded byVenugopal Konapala
- Finance engineeringUploaded byBJ Tiew
- matlab_tutorial.pdfUploaded byPrasad Kavthakar
- Module 01Uploaded bymaheshluintel
- Matlab documentsUploaded byMallikarjun Talwar
- 5892 MATLAB S-Function.pdfUploaded byBolWol
- laporan matlab baru.docxUploaded byAnonymous 8cT9Hsebyt
- Experiment 1Uploaded byAkbar Ali
- Matllab TutUploaded byAmatou Arrahmen
- ELCE402 Lab Exp00Uploaded bylulu1990
- LECTURE 1 IntroductionUploaded byRameshBabu N
- vibracionUploaded byWilber Carbajal Sulca
- Wireless Communications Basic LabsUploaded byTowfeeq Feroz
- DeberUploaded byVico TObando
- SimulinkUploaded byluimasther
- RC Electronics 2010Uploaded bykumareshbaba
- Proje ÖnerileriUploaded bymanci

- Network Analyst TutorialUploaded byEduard Matei
- Canny Edge Detection Tutorial.pdfUploaded byImfarosha Emma
- PSALM vs Maunlad Homes, Inc.Uploaded bylamadridrafael
- earth hazards cropped for weeblyUploaded byapi-261914272
- ANTENNAS-edge_2015_latest.pptx;filename= UTF-8''ANTENNAS-edge%202015%20latest.pptxUploaded byalfred calaunan
- Introduction to FLARToolKitUploaded byRawan Hm
- WTP3_OM_EN_988-10001-001_wUploaded bytecnicoeem
- 1.pdfUploaded byTedy Zulqirofik SE Akt
- AS_95433_LK-G5000_C_611H36_US_1048-1 (5)Uploaded bybertan dağıstanlı
- Executive Summary Nuclear Posture ReviewUploaded byRed Pill
- Common Mistakes When Writing Formal EmailUploaded byArdhan Wilyan
- 15 dual4.pptUploaded byAngad Sehdev
- Bsc Report Jane Feb 2008Uploaded byManuela Chadreque
- Mobile Piston Pump and MotorsUploaded bymaqvere
- SRS for Auctioning SystemUploaded bySiddu Rajeshwar
- Yamaha Rx v1067 Service ManualUploaded byGeorge Ion Șușală
- An Automation PCI Allocation Method for eNodeB and Home eNodeB CellUploaded byurfriendlyjoe
- PepsiCo. Strategic Plan DesignUploaded byG
- 62739592 No Easy Walk to Freedom Nelson MandelaUploaded bytheodros
- Manual_English for Child LabourUploaded bymaqsoodali786
- Lucky Dog: Pet owners will invest in premium products as disposable income risesUploaded byconsulting2011
- CHAPTER 3 Caselette - Audit of Cash and Cash Equivalents.docUploaded byRai Manduyog
- Armenian PrideUploaded byGonvilela
- Lesson 1 the HK DepartmentUploaded byReina
- icicibankUploaded byRohit Prasad
- P-681 Classic 300D PerkinsUploaded byGeorge Calderon
- Volvo V40 27.06.2017Uploaded byAntony Joe
- Sirvole K T 2007Uploaded byGerry Roberts
- Mahendra PatilUploaded bymallikarjun nayak
- IWkm 370d4 Ball Valve - IOM manualUploaded byAsemota Oghogho