SlideShare a Scribd company logo
Matlab_Harshal.pptx
1. OVERVIEW
• MATLAB (matrix laboratory) is a fourth-generation high-level programming language
and interactive environment for numerical computation, visualization and
programming. MATLAB is developed by MathWorks.
• It allows matrix manipulations; plotting of functions and data; implementation of
algorithms; creation of user interfaces; interfacing with programs written in other
languages, including C, C++, Java, and FORTRAN; analyze data; develop algorithms;
and create models and applications.
• It has numerous built-in commands and math functions that help you in
mathematical calculations, generating plots, and performing numerical methods.
MATLAB's Power of Computational Mathematics
MATLAB is used in every facet of computational mathematics.
Following are some commonly used mathematical calculations where it is used most commonly:
• Dealing with Matrices and Arrays
• 2-D and 3-D Plotting and graphics
• Linear Algebra
• Algebraic Equations
• Non-linear Functions
• Statistics
• Data Analysis
• Calculus and Differential Equations
• Numerical Calculations
• Integration
• Transforms
• Curve Fitting
• Various other special functions
FEATURES OF MATLAB
Following are the basic features of MATLAB:
• It is a high-level language for numerical computation, visualization and application development.
• It also provides an interactive environment for iterative exploration, design and problem solving.
• It provides vast library of mathematical functions for linear algebra, statistics, Fourier analysis, filtering,
optimization, numerical integration and solving ordinary differential equations.
• It provides built-in graphics for visualizing data and tools for creating custom plots.
• MATLAB's programming interface gives development tools for improving code quality, maintainability,
and maximizing performance.
• It provides tools for building applications with custom graphical interfaces.
• It provides functions for integrating MATLAB based algorithms with external applications and
languages such as C, Java, .NET and Microsoft Excel.
Uses of MATLAB
• MATLAB is widely used as a computational tool in science and engineering encompassing
the fields of physics, chemistry, math and all engineering streams. It is used in a range of
applications including:
• Signal processing and Communications
• Embeded Systemd
• Robotics
• Computer vision
• Image and video Processing
• Control systems
• Test and measurement
• Computational finance
• Computational biology
2. MATLAB ENVIRONMENT
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
• 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.
• Saving Your Work The save command is used for saving all the variables in the workspace, as a file
with .mat extension, in the current directory. For example, save myfile You can reload the file
anytime later using the load command. load myfile
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
PLOTTING
x = [0:5:100];
y = x;
plot(x, y)
x = [1 2 3 4 5 6 7 8 9 10];
x = [-100:20:100];
y = x.^2;
plot(x, y)
x = [0:0.01:10];
y = sin(x);
plot(x, y), xlabel('x'), ylabel('Sin(x)’),
title('Sin(x) Graph'), grid on, axis equal
x = [0 : 0.01: 10];
y = sin(x);
g = cos(x);
plot(x, y, x, g, '.-’),
legend('Sin(x)', 'Cos(x)')
MATLAB provides eight basic color options for drawing graphs. The following table shows the
colors and their codes:
x = [-10 : 0.01: 10];
y = 3*x.^4 + 2 * x.^3 + 7 * x.^2 + 2 * x + 9;
g = 5 * x.^3 + 9 * x + 2;
plot(x, y, 'r', x, g, 'g')
• Setting Axis Scales
• axis ( [xmin xmax ymin ymax] )
x = [0 : 0.01: 10];
y = exp(-x).* sin(2*x + 3);
plot(x, y),
axis([0 10 -1 1])
x = [0:0.01:5];
y = exp(-1.5*x).*sin(10*x);
subplot(1,2,1) plot(x,y), xlabel('x'),ylabel('exp(–1.5x)*sin(10x)'),axis([0 5 -1 1])
y = exp(-2*x).*sin(10*x);
subplot(1,2,2) plot(x,y),xlabel('x'),ylabel('exp(–2x)*sin(10x)'),axis([0 5 -1 1]
x = [1:10];
y = [75, 58, 90, 87, 50, 85, 92, 75, 60, 95];
bar(x,y),
xlabel('Student'),ylabel('Score'), title('First Sem:')
• A contour line of a function of two variables is a curve along which the function has a constant value.
Contour lines are used for creating contour maps by joining points of equal elevation above a given
level, such as mean sea level. MATLAB provides a contour function for drawing contour maps.
• The meshgrid command is used for generating a matrix of elements that give the range over x and y
along with the specification of increment in each case.
[x,y] = meshgrid(-5:0.1:5,-3:0.1:3);
%independent variables
g = x.^2 + y.^2; % our function
contour(x,y,g)
[x,y] = meshgrid(-5:0.1:5,-3:0.1:3);
%independent variables
g = x.^2 + y.^2; % our function
[C, h] = contour(x,y,g); % call the contour
function set(h,'ShowText','on','TextStep’,
get(h,'LevelStep')*2)
[x,y] = meshgrid(-2:.2:2);
g = x .* exp(-x.^2 - y.^2);
surf(x, y, g)
DECISION MAKING
a = 10; % check the condition using if statement
if a < 20 % if condition is true then print the
following
fprintf('a is less than 20n' );
end
fprintf('value of a is : %dn', a);
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx
Matlab_Harshal.pptx

More Related Content

PPTX
Mat lab workshop
PPTX
MATLAB_PROGRAMMING_BASICTOADVANCEDSCRIPT
PDF
MATLAB Programming
PPT
MatlabIntro (1).ppt
PPT
Introduction to Matlab.ppt
PPTX
Matlab ppt
PDF
R programmingmilano
PPT
Matlab Tutorial.ppt
Mat lab workshop
MATLAB_PROGRAMMING_BASICTOADVANCEDSCRIPT
MATLAB Programming
MatlabIntro (1).ppt
Introduction to Matlab.ppt
Matlab ppt
R programmingmilano
Matlab Tutorial.ppt

Similar to Matlab_Harshal.pptx (20)

PPT
MATLAB-tutorial for Image Processing with Lecture 3.ppt
PDF
Tutorial matlab
PDF
Tutorialmatlab kurniawan.s
PPT
MATLAB workshop lecture 1MATLAB work.ppt
PPTX
Introduction to MATLAB
PPTX
Summer training matlab
PDF
Introduction to MATLAB
PPT
MATLAB_CIS601-03.ppt
PPTX
MATLAB & Image Processing
PPTX
MATLAB Workshop for project and research
PDF
Summer training matlab
PPTX
Lines and planes in space
PPT
INTRODUCTION TO MATLAB for PG students.ppt
PPTX
MATLAB : Introduction , Features , Display Windows, Syntax, Operators, Graph...
PPT
Matlab introduction
PDF
MATLAB for Technical Computing
PPT
Basic concept of MATLAB.ppt
PPT
Introduction to Matlab - Basic Functions
PDF
Matlab-free course by Mohd Esa
PDF
Matlab lec1
MATLAB-tutorial for Image Processing with Lecture 3.ppt
Tutorial matlab
Tutorialmatlab kurniawan.s
MATLAB workshop lecture 1MATLAB work.ppt
Introduction to MATLAB
Summer training matlab
Introduction to MATLAB
MATLAB_CIS601-03.ppt
MATLAB & Image Processing
MATLAB Workshop for project and research
Summer training matlab
Lines and planes in space
INTRODUCTION TO MATLAB for PG students.ppt
MATLAB : Introduction , Features , Display Windows, Syntax, Operators, Graph...
Matlab introduction
MATLAB for Technical Computing
Basic concept of MATLAB.ppt
Introduction to Matlab - Basic Functions
Matlab-free course by Mohd Esa
Matlab lec1
Ad

Recently uploaded (20)

PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PPTX
Information Storage and Retrieval Techniques Unit III
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
Fundamentals of Mechanical Engineering.pptx
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PPT
Total quality management ppt for engineering students
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PPTX
UNIT - 3 Total quality Management .pptx
PDF
PPT on Performance Review to get promotions
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PDF
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
Information Storage and Retrieval Techniques Unit III
Safety Seminar civil to be ensured for safe working.
Fundamentals of Mechanical Engineering.pptx
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
III.4.1.2_The_Space_Environment.p pdffdf
Total quality management ppt for engineering students
Nature of X-rays, X- Ray Equipment, Fluoroscopy
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
UNIT - 3 Total quality Management .pptx
PPT on Performance Review to get promotions
R24 SURVEYING LAB MANUAL for civil enggi
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
Automation-in-Manufacturing-Chapter-Introduction.pdf
Exploratory_Data_Analysis_Fundamentals.pdf
Ad

Matlab_Harshal.pptx

  • 2. 1. OVERVIEW • MATLAB (matrix laboratory) is a fourth-generation high-level programming language and interactive environment for numerical computation, visualization and programming. MATLAB is developed by MathWorks. • It allows matrix manipulations; plotting of functions and data; implementation of algorithms; creation of user interfaces; interfacing with programs written in other languages, including C, C++, Java, and FORTRAN; analyze data; develop algorithms; and create models and applications. • It has numerous built-in commands and math functions that help you in mathematical calculations, generating plots, and performing numerical methods.
  • 3. MATLAB's Power of Computational Mathematics MATLAB is used in every facet of computational mathematics. Following are some commonly used mathematical calculations where it is used most commonly: • Dealing with Matrices and Arrays • 2-D and 3-D Plotting and graphics • Linear Algebra • Algebraic Equations • Non-linear Functions • Statistics • Data Analysis • Calculus and Differential Equations • Numerical Calculations • Integration • Transforms • Curve Fitting • Various other special functions
  • 4. FEATURES OF MATLAB Following are the basic features of MATLAB: • It is a high-level language for numerical computation, visualization and application development. • It also provides an interactive environment for iterative exploration, design and problem solving. • It provides vast library of mathematical functions for linear algebra, statistics, Fourier analysis, filtering, optimization, numerical integration and solving ordinary differential equations. • It provides built-in graphics for visualizing data and tools for creating custom plots. • MATLAB's programming interface gives development tools for improving code quality, maintainability, and maximizing performance. • It provides tools for building applications with custom graphical interfaces. • It provides functions for integrating MATLAB based algorithms with external applications and languages such as C, Java, .NET and Microsoft Excel.
  • 5. Uses of MATLAB • MATLAB is widely used as a computational tool in science and engineering encompassing the fields of physics, chemistry, math and all engineering streams. It is used in a range of applications including: • Signal processing and Communications • Embeded Systemd • Robotics • Computer vision • Image and video Processing • Control systems • Test and measurement • Computational finance • Computational biology
  • 11. • 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. • Saving Your Work The save command is used for saving all the variables in the workspace, as a file with .mat extension, in the current directory. For example, save myfile You can reload the file anytime later using the load command. load myfile
  • 26. PLOTTING x = [0:5:100]; y = x; plot(x, y) x = [1 2 3 4 5 6 7 8 9 10]; x = [-100:20:100]; y = x.^2; plot(x, y)
  • 27. x = [0:0.01:10]; y = sin(x); plot(x, y), xlabel('x'), ylabel('Sin(x)’), title('Sin(x) Graph'), grid on, axis equal x = [0 : 0.01: 10]; y = sin(x); g = cos(x); plot(x, y, x, g, '.-’), legend('Sin(x)', 'Cos(x)')
  • 28. MATLAB provides eight basic color options for drawing graphs. The following table shows the colors and their codes:
  • 29. x = [-10 : 0.01: 10]; y = 3*x.^4 + 2 * x.^3 + 7 * x.^2 + 2 * x + 9; g = 5 * x.^3 + 9 * x + 2; plot(x, y, 'r', x, g, 'g')
  • 30. • Setting Axis Scales • axis ( [xmin xmax ymin ymax] ) x = [0 : 0.01: 10]; y = exp(-x).* sin(2*x + 3); plot(x, y), axis([0 10 -1 1])
  • 31. x = [0:0.01:5]; y = exp(-1.5*x).*sin(10*x); subplot(1,2,1) plot(x,y), xlabel('x'),ylabel('exp(–1.5x)*sin(10x)'),axis([0 5 -1 1]) y = exp(-2*x).*sin(10*x); subplot(1,2,2) plot(x,y),xlabel('x'),ylabel('exp(–2x)*sin(10x)'),axis([0 5 -1 1]
  • 32. x = [1:10]; y = [75, 58, 90, 87, 50, 85, 92, 75, 60, 95]; bar(x,y), xlabel('Student'),ylabel('Score'), title('First Sem:')
  • 33. • A contour line of a function of two variables is a curve along which the function has a constant value. Contour lines are used for creating contour maps by joining points of equal elevation above a given level, such as mean sea level. MATLAB provides a contour function for drawing contour maps. • The meshgrid command is used for generating a matrix of elements that give the range over x and y along with the specification of increment in each case. [x,y] = meshgrid(-5:0.1:5,-3:0.1:3); %independent variables g = x.^2 + y.^2; % our function contour(x,y,g)
  • 34. [x,y] = meshgrid(-5:0.1:5,-3:0.1:3); %independent variables g = x.^2 + y.^2; % our function [C, h] = contour(x,y,g); % call the contour function set(h,'ShowText','on','TextStep’, get(h,'LevelStep')*2)
  • 35. [x,y] = meshgrid(-2:.2:2); g = x .* exp(-x.^2 - y.^2); surf(x, y, g)
  • 36. DECISION MAKING a = 10; % check the condition using if statement if a < 20 % if condition is true then print the following fprintf('a is less than 20n' ); end fprintf('value of a is : %dn', a);