SlideShare a Scribd company logo
mat lab introduction and basics to learn
 Mat lab is very useful in design field now a days it is
widely using software
 It has so many predefined functions
 It is space sensitive and case sensitive
 It is used in rocket launching and designing of
mechanical parts
Some Mat Lab development windows
 Command Window : where you enter commands
 Command History : It shows the previously entered
commands
 Editor : Here we edit programs
COMMANDS
 CLEAR : remove items from workspace
 WHO: list variables in workspace
 QUIT: close matlab
Math Functions
 Abs(x)=mod x
 Sqrt(x)=root x
 Round(x)=rounds to nearest
integer
 Fix(x)=round to nearest integer
towards zero
 Ceil(x)=nearest to infinite
 Ceil(x)=nearest to –ve infinite
 Rem(x,y)=gives remainder
 Exp(x)=e^x
 Log(x)=log x base e
 Sin(x)
 Cos(x)
 Tan(x)
 sinh(x)
 Cosh(x)
 Tanh(x)
Matrix entering in mat
 A=[1 2 3;2 3 4]
 Output we get here is
1 2 3
2 3 4
Colon for matrix
A(:,n) = selects all row elements in nth column of A
A(n,:) = selects all column elements in nth row of A
A(:,m:n)=selects all rows b/w columns m & n
A(m:n,:) = selects all columns b/w rows m &n
A(m:n,p:q) = selects elements in rows b/w m & n and
colmns b/w p &q
Isequal(a,b) = if element in a=b returns 1 otherwise 0
Ismember(a,b) = if a element in b returns 1 otherwise 0
Some more commands
 Magic(x)
 Sum(x)
 X’
 Diag(x)
 Fliplr(x)
 Flipud(x)
 Size(x)
 X(i,j)=n
 Length(a)
 Mean(A)
 Max(a)
 [d,n]=max(a)
 Min(a)
 Sort(a)
 Median(a)
 Std(a)
 Rand
 Rand(m,n)
Some functions
1 . Syms x
f = inline (‘x^2+2x+1)
2 . Syms (u,v)
simplify((u^3-v^3)/(u-v))
3. Syms a
syms b
syms c
syms x
solve(‘a*x^2-b*x+c)
Solving polynomial
 5*s^5+7*s^4+2*s^3+6*s+1
 To enter into the mat lab software for working
 x=[5 7 0 2 6 1]
 At the value of s=2
 Enter
 X=polyval([x],2)
 X=278
Muliplying two polynomials
 Here we write
 X=[1 2 3]
 Y=[3 4 5]
 Z =conv(x,y)
 Z=2 11 29 35
Statements
 If/elseif/else
 For loop
 While loop
Reading & writing diff files
For reading text files
X = dimread(‘abc.txt’,’,’)
For writing text files
X=[1 2 3 5 7 ]
dlmwrite(‘uvw.txt’,x);
For xls files enter xls in place dlm
Reading image files
F=uigetfile(‘*.m,*.bmp,*.gif,*.jpg’,’xxxxx’)
For plotting graphs
Plot(x,y)

More Related Content

PPTX
Matlab ploting
PDF
Matlab practice
PDF
Matlab plotting
PDF
Matlab cheatsheet
PPTX
PPTX
Introduction to matlab lecture 4 of 4
PDF
Matlab cheatsheet
PPTX
Intro to matlab
Matlab ploting
Matlab practice
Matlab plotting
Matlab cheatsheet
Introduction to matlab lecture 4 of 4
Matlab cheatsheet
Intro to matlab

What's hot (18)

PPTX
Matlab plotting
PPT
Sparse Matrix and Polynomial
PPTX
PPTX
Edu presentation1
PPT
C++ ammar .s.q
PPTX
graphs plotting in MATLAB
PDF
Abstracting over the Monad yielded by a for comprehension and its generators
PPT
Module 2 topic 2 notes
PPTX
Intro to Matlab programming
DOC
Matlabtut1
PPTX
Output primitives in Computer Graphics
PPTX
Sas reg multi
PDF
Matlab plotting
PDF
Applied numerical methods lec10
PPT
Numerical integration
PPTX
Advanced Complex Analysis
PDF
5. R basics
 
PDF
Ss matlab solved
Matlab plotting
Sparse Matrix and Polynomial
Edu presentation1
C++ ammar .s.q
graphs plotting in MATLAB
Abstracting over the Monad yielded by a for comprehension and its generators
Module 2 topic 2 notes
Intro to Matlab programming
Matlabtut1
Output primitives in Computer Graphics
Sas reg multi
Matlab plotting
Applied numerical methods lec10
Numerical integration
Advanced Complex Analysis
5. R basics
 
Ss matlab solved
Ad

Viewers also liked (20)

PPTX
Matlab 1 level_1
PPTX
Introduction to programming using mat lab
PPTX
CIV1900 Matlab - Plotting & Coursework
PDF
R Programming: Numeric Functions In R
PPTX
Variables in matlab
DOCX
Matlab time series example
PDF
metode numerik stepest descent dengan rerata aritmatika
PPTX
Introduction to Matlab Scripts
DOCX
SSS RESUME_3
PPT
Loops in matlab
PDF
Modul1 metode bagi dua Praktikum Metode Numerik
PDF
Modul2 metode regula falsi praktikum metode numerik
PPTX
User defined Functions in MATLAB Part 1
PPT
Fungsi grafik di matlab
PPTX
User Defined Functions in MATLAB Part-4
PPT
Mat Lab
PDF
Metode numerik-buku-ajar-unila
PDF
Transparency & Meltability in Hot Process Soap - A Guide for Making your own ...
PPTX
Band Combination of Landsat 8 Earth-observing Satellite Images
Matlab 1 level_1
Introduction to programming using mat lab
CIV1900 Matlab - Plotting & Coursework
R Programming: Numeric Functions In R
Variables in matlab
Matlab time series example
metode numerik stepest descent dengan rerata aritmatika
Introduction to Matlab Scripts
SSS RESUME_3
Loops in matlab
Modul1 metode bagi dua Praktikum Metode Numerik
Modul2 metode regula falsi praktikum metode numerik
User defined Functions in MATLAB Part 1
Fungsi grafik di matlab
User Defined Functions in MATLAB Part-4
Mat Lab
Metode numerik-buku-ajar-unila
Transparency & Meltability in Hot Process Soap - A Guide for Making your own ...
Band Combination of Landsat 8 Earth-observing Satellite Images
Ad

Similar to mat lab introduction and basics to learn (20)

PPT
Introduction to MATLAB
PPT
MATLAB-Introd.ppt
PDF
PPT
Introduction to MatLab programming
PPTX
Introduction to MATLAB Programming for Engineers
PDF
Matlab booklet
PPTX
Introduction to Matlab and application.pptx
PPTX
presentation.pptx
PPTX
Matlab Tutorial
PPT
Matlab1
PPTX
Introduction to matlab lecture 2 of 4
PPTX
1. Introduction.pptx
PDF
Matlab tutorial 2
PPT
Learn Matlab
PDF
An Introduction to MATLAB with Worked Examples
PPT
matlab_tutorial.ppt
PPT
matlab_tutorial.ppt
PPT
matlab_tutorial.ppt
PPTX
INTRODUCTION TO MATLAB presentation.pptx
PPT
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
Introduction to MATLAB
MATLAB-Introd.ppt
Introduction to MatLab programming
Introduction to MATLAB Programming for Engineers
Matlab booklet
Introduction to Matlab and application.pptx
presentation.pptx
Matlab Tutorial
Matlab1
Introduction to matlab lecture 2 of 4
1. Introduction.pptx
Matlab tutorial 2
Learn Matlab
An Introduction to MATLAB with Worked Examples
matlab_tutorial.ppt
matlab_tutorial.ppt
matlab_tutorial.ppt
INTRODUCTION TO MATLAB presentation.pptx
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Spectroscopy.pptx food analysis technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Big Data Technologies - Introduction.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation theory and applications.pdf
Spectral efficient network and resource selection model in 5G networks
Dropbox Q2 2025 Financial Results & Investor Presentation
Spectroscopy.pptx food analysis technology
MIND Revenue Release Quarter 2 2025 Press Release
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation_ Review paper, used for researhc scholars
Chapter 3 Spatial Domain Image Processing.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
sap open course for s4hana steps from ECC to s4
Understanding_Digital_Forensics_Presentation.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Machine learning based COVID-19 study performance prediction
Big Data Technologies - Introduction.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Advanced methodologies resolving dimensionality complications for autism neur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
cuic standard and advanced reporting.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation theory and applications.pdf

mat lab introduction and basics to learn

  • 2.  Mat lab is very useful in design field now a days it is widely using software  It has so many predefined functions  It is space sensitive and case sensitive  It is used in rocket launching and designing of mechanical parts
  • 3. Some Mat Lab development windows  Command Window : where you enter commands  Command History : It shows the previously entered commands  Editor : Here we edit programs
  • 4. COMMANDS  CLEAR : remove items from workspace  WHO: list variables in workspace  QUIT: close matlab
  • 5. Math Functions  Abs(x)=mod x  Sqrt(x)=root x  Round(x)=rounds to nearest integer  Fix(x)=round to nearest integer towards zero  Ceil(x)=nearest to infinite  Ceil(x)=nearest to –ve infinite  Rem(x,y)=gives remainder  Exp(x)=e^x  Log(x)=log x base e  Sin(x)  Cos(x)  Tan(x)  sinh(x)  Cosh(x)  Tanh(x)
  • 6. Matrix entering in mat  A=[1 2 3;2 3 4]  Output we get here is 1 2 3 2 3 4
  • 7. Colon for matrix A(:,n) = selects all row elements in nth column of A A(n,:) = selects all column elements in nth row of A A(:,m:n)=selects all rows b/w columns m & n A(m:n,:) = selects all columns b/w rows m &n A(m:n,p:q) = selects elements in rows b/w m & n and colmns b/w p &q Isequal(a,b) = if element in a=b returns 1 otherwise 0 Ismember(a,b) = if a element in b returns 1 otherwise 0
  • 8. Some more commands  Magic(x)  Sum(x)  X’  Diag(x)  Fliplr(x)  Flipud(x)  Size(x)  X(i,j)=n  Length(a)  Mean(A)  Max(a)  [d,n]=max(a)  Min(a)  Sort(a)  Median(a)  Std(a)  Rand  Rand(m,n)
  • 9. Some functions 1 . Syms x f = inline (‘x^2+2x+1) 2 . Syms (u,v) simplify((u^3-v^3)/(u-v)) 3. Syms a syms b syms c syms x solve(‘a*x^2-b*x+c)
  • 10. Solving polynomial  5*s^5+7*s^4+2*s^3+6*s+1  To enter into the mat lab software for working  x=[5 7 0 2 6 1]  At the value of s=2  Enter  X=polyval([x],2)  X=278
  • 11. Muliplying two polynomials  Here we write  X=[1 2 3]  Y=[3 4 5]  Z =conv(x,y)  Z=2 11 29 35
  • 13. Reading & writing diff files For reading text files X = dimread(‘abc.txt’,’,’) For writing text files X=[1 2 3 5 7 ] dlmwrite(‘uvw.txt’,x); For xls files enter xls in place dlm Reading image files F=uigetfile(‘*.m,*.bmp,*.gif,*.jpg’,’xxxxx’) For plotting graphs Plot(x,y)