0% found this document useful (0 votes)
58 views24 pages

Internship Report: Navya Srivastava 1900520310040 Semester: 5th

MATLAB is a proprietary multi-paradigm programming language and numeric computing environment used for matrix manipulations, plotting functions and data, implementing algorithms, and interfacing with other programs. This internship report summarizes Navya Srivastava's 5-week MATLAB training, which included introductions to the MATLAB interface and syntax, writing scripts, working with variables and arrays, mathematical operations, plotting data, and advanced plotting techniques. The goal was to provide a basic understanding of MATLAB functionality and programming.

Uploaded by

Mukil Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views24 pages

Internship Report: Navya Srivastava 1900520310040 Semester: 5th

MATLAB is a proprietary multi-paradigm programming language and numeric computing environment used for matrix manipulations, plotting functions and data, implementing algorithms, and interfacing with other programs. This internship report summarizes Navya Srivastava's 5-week MATLAB training, which included introductions to the MATLAB interface and syntax, writing scripts, working with variables and arrays, mathematical operations, plotting data, and advanced plotting techniques. The goal was to provide a basic understanding of MATLAB functionality and programming.

Uploaded by

Mukil Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Internship Report

Navya Srivastava
1900520310040
Semester: 5th
Bachelor Of Technology
Electronics And Communication Engineering
Submission Date: 22nd December, 2021
MATLAB Training

MATLAB is a proprietary multi-paradigm programming language and numeric computing environment


developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data,
implementation of algorithms, creation of user interfaces, and interfacing with programs written in other
languages.

Official site : https://in.mathworks.com/products/matlab.html?s_tid=hp_products_matlab


Why MATLAB?

Designed for engineers & scientists Versatility It's fast

MATLAB specializes in running Whether it is machine learning, Mathematical operations and code
mathematical operations, analyzing robotics, data science, IoT, or web are processed quickly allowing you
data, and testing scientific models. development, MATLAB is used to be more productive and test
It's a tool of choice for engineers everywhere. different models with ease.
and scientists.
Week 1 - Introduction

● Training Overview Video


● Introduction to MATLAB
● Installation & Interface
● Syntax and Scientific
Notation
● Introduction to MATLAB

MATLAB is a software package for high-performance


● Training Overview and mathematical computation, visualization, and programming
Introduction environment. It provides an interactive environment with
hundreds of built-in functions for technical computing,
The training’s main emphasis is to give the graphics, and animations. MATLAB stands for Matrix
trainee a basic understanding of the ways Laboratory.
of functioning, writing and performing
simple programs and algorithms .
MATLAB is a modern programming language environment,
The training gradually goes from all the and it has refined data structures, includes built-in editing and
initial and basic concept like scripting to debugging tools, and supports object-oriented programming.
solving the mathematical equations. MATLAB is Multi-paradigm. So, it can work with multiple
types of programming approaches, such as Functional,
Object-Oriented, and Visual.
Syntax and scientific notation
● MATLAB environment behaves like a super-complex calculator. You can enter commands at the
>> command prompt.
● MATLAB is an interpreted environment. In other words, you give a command and MATLAB
executes it right away.

Scientific notation in MATLAB


For very large numbers or very small numbers it is more convenient to express the number
in scientific notation using a power of 10.
For example, 1,400,000 can be written as 1.4 x 106. In MATLAB (and other programming
languages) a convenient shorthand for this is 1.4e6
Use of Semicolon (;) in MATLAB
Semicolon (;) indicates end of statement. However, if one wants to suppress and hide the MATLAB output for an expression,
add a semicolon after the expression.
For example,
o
x = 3;
y = x + 5

This will give the following output:

y = 8
Week 2-Foundations

● Writing Scripts
● Variables
● Arrays & Matrices
Writing scripts in MATLAB
The simplest type of MATLAB program is called a script. A script is a file that contains multiple
sequential lines of MATLAB commands and function calls. You can run a script by typing its
name at the command line.
Naming Variables

Variable names consist of a letter followed by any number of letters, digits or underscore.
MATLAB is case-sensitive.
Variable names can be of any length, however, MATLAB uses only first N characters, where N is given by
the function namelengthmax.

Examples of valid names: Examples of invalid names:

x6 6x

lastValue end

n_factorial n!
Working with Variables and Arrays in MATLAB zeros(n) Creates a n x n matrix
of zeros.

zeros(m,n) Creates a m x n matrix


of zeros
● The structural unit of data in any MATLAB program is the zeros(size(arr)) Create a matrix of zeros
array. An array is a collection of record values organized of the same size as arr.
into rows and columns and known by a single name. Arrays
can be allocated as either vectors or matrices. The term ones(n) Creates a n x n matrix
of ones.
"vector" is generally used to define an array with only one
dimension, while the term "matrix" is usually used to ones(m,n) Creates a m x n matrix
of ones.
determine an array with two or more dimensions.
● Examples are eye(n) Creates a n x n identity
matrix.
array = [1 2 3 4];
  c = [1 2; 3 4];
Week 3-Mathematics

● Math Review
● Programming Math
MATLAB Arithmetic Operators
Arithmetic operators help in performing simple arithmetic operations like addition, subtraction, multiplication, division, and power.

Symbol Role Corresponding function

+ Addition plus
Example
- Subtraction minus A = magic (3)   
.* Element-wise multiplication times
A =   
        8       1       6   
* Matrix multiplication mtimes         3       5       7   
./ Element-wise right division rdivide         4       9       2   
3 * A   
.\ Element-wise left division ldivide ans=  
/ Matrix right division mrdivide         24    3    18  
         9     15   21  
\ Matrix left division mldivide
        12    27     6  
.^ Element-wise power power

^ Matrix power mpower

.' Transpose transpose


MATLAB Relational Operators
Relational operators perform value comparison operations.

Symbol Role Corresponding function


Example
== Equal to eq A = [2 7 6; 9 0 5; 3 0.5 6];   
B = [8 7 0; 3 2 5; 4 -1 7];   
~= Not equal to ne A == B   
> Greater than gt ans =   
           0    1    0   
>= Greater than or equal to ge            0    0    1   
           0    0    0  
< Less than lt
<= Less than or equal to le
Week 4- Plotting

● Plotting Data
● Type of Plots
● Advanced & 3D Plots
Generating Sub-Plots
We can use the subplot function to display
multiple plots in different sub-regions of
MATLAB Plotting the same window. The subplot commands
Plotting is a graphical representation of a data set that
require three integer arguments:
shows a relationship between two or more variables.
MATLAB plots play an essential role in the field of subplot (m, n, p)  
mathematics, science, engineering, technology, and Splits the figure into an m x n matrix. The
finance for statistics and data analysis. variable p identifies the part of the window
There are several functions available in MATLAB to where the next plot will be drawn. For
create 2-dimensional and 3-dimensional plots. example, if the command
Creating Plotting
MATLAB makes it easy to create plots. For example in
2D, is to take a vector of a- coordinates, a = (a1... an ),
and a vector of b-coordinates, b = (b1...bn), locate the
points (ai...bi), with i = 1, 2. . . n and then connect them
by straight lines.
The MATLAB commands to plot a graph is plot (a, b).
MATLAB 3D Plots
MATLAB also includes a wide variety of
three-dimensional plots that can be
MATLAB 2-D Plots useful for displaying certain types of
There are many specific graphics data. In general, three-dimensional plots
functions for 2-D plotting. They are are helpful for displaying two types of
used as alternatives to the data:
plot command we have just discussed. Two variables that are functions of the
MATLAB help desk lists more than 20 same independent variable, when you
types of two-dimensional plots. wish to emphasize the importance of the
Examples include stem plots, stair plots,
independent variable.
bar plots, pie plots, and compass plots.
A single variable that is a function of two
Here we are going to discuss the 2D
independent variables, z = f (x, y).
plotting function in MATLAB.
Week 5- Programming

● Core Logic
● Loops & Statements
MATLAB nested if-else

If statements can be nested, but each if statement


requires the end keyword.

Syntax:
MATLAB if-else... end statement if expression  
    Statements  
If the first condition is not true, then we can     if expression  
define other statements to run by         Statements  
usingthe else keyword.     else  
        Statements  
Syntax:     end  
if expression   elseif expression  
         Statements       Statements  
else       if expression  
         Statements           Statements  
end       end  
else   
    Statements  
end
MATLAB Loops
A loop statement allow us to execute a statement or group of statements multiple times.
MATLAB provides different types of loops to handle looping requirements, including while loops, for
loops, and nested loops. If we are trying to declare or write our own loops, we need to make sure that
the loops are written as scripts and not directly in the Command Window.
Two additional command, break and continue, can be used to create a third type of loop, known
as midpoint break loop. Midpoint break loop is useful for situations where the commands in the loop
must be executed at least once, but where the decision to exit the loop is based on some criterion.

Types of Loops
There are two types of loop in MATLAB
1.for
2.while
Syntax
Syntax
for index = values  
 while <expression>  
 <program statements>  
 <statements>  
 ...      
end   
end   
Week 6- Case Studies and Final Project

Ordinary differential equations

Use various numerical methods to solve an


ordinary differential equation in MATLAB and
plot the calculated datasets on a graph to
compare different solutions.
Project - Image Processing using Matlab
Image processing is the process of manipulating the digital properties of an image to improve its
quality or to get the desired information from the image. It entails importing the image in the
image processing application, analysing the image, then manipulating the image to get a suitable
output that can produce desired results.
Digital image processing algorithms can be used to:
● Improve clarity, and remove noise and other artefacts
● Extract the size, scale, or number of objects in a scene
● Prepare images for display or printing
● Compress images for communication across a network
Github Link: https://github.com/cyberpanda18/ImageProcessingInMATLAB
i = imread('scene.png') %This will assign the image temp(:,:,3) = temp(:,:,3) + 100;
to i imshow(temp)
imshow(i) %display image %Image deblurring
figure; PSF = fspecial('motion',50,10);
%image filtering Idouble = im2double(i);
Red = i(:,:,1); blurred = imfilter(Idouble,PSF,'conv','circular');
Green = i(:,:,2); imshow(blurred)
Blue = i(:,:,3); figure;
temp = i; wnr1 = deconvwnr(blurred,PSF);
imhist(Red) imshow(wnr1)
figure; figure;
temp = i; %Finding an area in an image of a specific color
temp(:,:,1) = temp(:,:,1) + 100; % Thresholding is assigning pixels to certain classes based
imshow(temp) on intensity.
figure; %example :finding the area of a water body in a satellite
imhist(Green) Map.
figure; i2 = rgb2gray(i); % make a gray scale image of i
temp = i; imshow(i2)
temp(:,:,2) = temp(:,:,2) + 100; figure;
imshow(temp) imhist(i2)
figure; figure;
imhist(Blue) imshowpair(i,BW,'montage')
figure; stats = regionprops('table',BW,'all');
temp = i;

You might also like