# Category: Matlab

Matlab

## Contour plot of images in Matlab

We can use imcontour(<image>) function to compute contour plot of the data in an intensity image. It sets up the axes for orientation and aspect ratio of the image. Example Output

## Random Matrix in Matlab

randi() function is used to retrieve an array of integer, valued from give list in order of m*n dimensions used as : randi([<start range> <ending range>],<number of rows>,<number of columns>) Example

## Writing data to file in Matlab using fprintf

fprintf is used to write data to file. Example Output (anyFile.txt)

## REPMAT for repeating array patterns

repmat is used for producing repeating matrix in matlab arrays. Syntax repmat( <matrix>, <number of rows> , <number of columns>) Example

## Plotting points in Matlab

plot function is used to plot variables in Matlab. Example Output

## Determinant of a matrix in Matlab

Determinant tells us values that are useful in systems of linear equations, it also helps us to find inverse of a matrix, also useful in calculus and more, this is calculated as : (4...

## Extracting video frames from specific index in matlab

When there is not enough memory available for extracting all the video frames in matlab, we often read specific frames by giving the indices instead of reading all of the frames into the memory....

## Extracting frames from videos in Matlab

mmreader class is used to read a video object and then this video object is used to read number of frames as obj.NumberOfFrames Example

## plot images in matlab

figure : figure creates figure graphics objects. Figure objects are the individual windows on the screen in which the MATLAB software displays graphical output. Example Output

## imnoise (adding noise to images)

imnoise is used to add noise in images. Syntax Description A = imnoise(I,type) adds noise of a given type to the intensity image I. type is a string that specifies any of the following...

## double function Matlab

double() function Convert symbolic matrix to MATLAB numeric form. Syntax r = double(S) Description r = double(S) converts the symbolic object S to a numeric object r. Input Arguments s Symbolic constant, constant expression,...

## subplot function in matlab

subplot() function is used to plot 1 or more images on the same common MATLAB panel. Syntax subplot(<no of rows>,<no of columns>,<position of element from top left>), <image>; Example Output

## Logical AND (&&) operator matlab

The single ampersand & is the logical AND operator. The double ampersand && is again a logical AND operator that employs short-circuiting behaviour. Short-circuiting just means the second operand (right hand side) is evaluated...

## If else statement matlab

if expression, statements, end evaluates an expression, and executes a group of statements when the expression is true. Example Output

## Subtract two images Matlab

The pixel subtraction operator takes two images as input and produces as output a third image whose pixel values are simply those of the first image minus the corresponding pixel values from the second...

## Blending images using imadd Matlab

Blending Adding images together produces a composite image of both input images. This can be used to produce blending effects using weighted addition. Example Output