Matlab

23
EVID Solutions 06/06/22 EVID Solutions and IEEE EVID Solutions and IEEE SPCE-SPIT SPCE-SPIT Presents

description

Image Processing

Transcript of Matlab

Page 1: Matlab

EVID Solutions04/08/23

EVID Solutions and IEEE SPCE-EVID Solutions and IEEE SPCE-SPITSPIT

Presents

Page 2: Matlab

Topics CoveredMATLABMATLAB – GUIImage ProcessingSteganographySteganography – GUIEncryptionCompression

Page 3: Matlab

Agenda for Day-1MATLABMATLAB – GUIImage ProcessingSteganography – An Introduction

Page 4: Matlab
Page 5: Matlab

Topics CoveredWhat is MATLAB?MATLAB EnvironmentMatrix ManipulationFunctionsLoopsPlotsBasic IP Commands

Page 6: Matlab

What is MATLAB?A research and development tool

Developed by Mathworks Inc.

MATLAB = MATrix LABoratory

Why MATLAB?

Page 7: Matlab

MATLAB EnvironmentCommand WindowWorkspaceCommand HistoryM-File Editor

Page 8: Matlab

04/08/23

1. Command Window, Workspace

2. Command History

MATLAB Environment

Page 9: Matlab

MATRIX Manipulations• Defining an Integer:

• Defining a 2-d column Matrix:

• Defining a 2-d row Matrix:

Page 10: Matlab

• Defining a general 2-d Matrix:

• Defining a general 3-d Matrix:

• Defining a blank Matrix:

MATRIX Manipulations

Page 11: Matlab

+ Addition

- Subtraction

* Multiplication

/ Division

\ Left division

^ Power

‘ Complex conjugate transpose

( ) Specify evaluation order

Operators - Arithmetic

Page 12: Matlab

< Less than

<= Less than or equal to

> Greater than

>= Greater than or equal to

== Equal to

~= Not equal to

Operators – Relational

Page 13: Matlab

AND A & B

OR A | B

NOT ~A

XOR xor(A,B)

Operators - Logical

Page 14: Matlab

Exercise 1Optimal code for

Taking Input from 1 to 10 Getting square of each integer Summation of all squares Display of final value

Page 15: Matlab

• For finding inverse of matrix;x= inv(a);

• For finding the determinant of matrix;x= det(a);

• For finding the transpose of matrix;x= trans(a);

• For Calculating the square root;x= sqrtm(a);

• For calculating the sum of all elements;x= sum(a);

Functions

Page 16: Matlab

• To create a matrix with all elements as 1;x= ones(k);

• To create magic square matrix;x= magic(k);

• For finding the size of matrix;x= size(a);

• For finding the number of elements in matrix;

x= numel(a);

• For finding the maximum, minimum value in a matrix;

x= max(a); y=min(a);

Functions

Page 17: Matlab

• Main types:

1. for:for i=1:10

//Place your code hereend

2. while:while(1)//Place your code here

end

3. if:if (Condition)//Place your code here

end

Loops in MATLAB

Page 18: Matlab

Exercise 2Optimal Code for

Take any two input numbersConvert them into 8-bit binary Concatenate both of them together Form 5-6-5 matrices from the available 16-bit

data

Page 19: Matlab

Plots in MATLABCommands covered: plot, xlabel, ylabel,

title grid, axis, stem, subplot xlabel('time (sec)'); ylabel('step

response'); title('My Plot'); Eg:To plot more than one graph on the

screen, use the command subplot(mnp) which partitions the screen into an mxn grid where p determines the position of the particular graph counting the upper left corner as p=1. For example,

subplot(211),semilogx(w,magdb); subplot(212),semilogx(w,phase);

Page 20: Matlab

3-d Plots in MATLABx=[0:10]; y=[0:10]; z=x’*y;mesh(x,y,z); title(‘3-D Graph’);

Page 21: Matlab

Exercise 3Optimal Code for

Create 5 x 5 matrix in Excel Import the matrix in MATLAB Use masking to remove any value above 100Export the matrix from MATLABRead new image in Excel

Page 22: Matlab

Basic IP CommandsTo Read an Image:

imread()

To Display an Image: imshow() imview()

To Write an Image:Imwrite()

Page 23: Matlab