SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
MATLAB Commands and Functions
Dr. Brian Vick
Mechanical Engineering Department
Virginia Tech
General Purpose Commands
Operators and Special Characters / 3
Commands for Managing a Session / 3
Special Variables and Constants / 4
System and File Commands / 4

Input/Output and Formatting Commands
Input/Output Commands / 5
Format Codes for fprintf and fscanf / 5
Numeric Display Formats / 5

Vector, Matrix and Array Commands
Array Commands / 6
Special Matrices / 6
Matrix Arithmetic / 6
Matrix Commands for Solving Linear Equations / 6
Cell Array Functions / 7
Structure Functions / 7

Plotting Commands
Basic xy Plotting Commands / 8
Plot Enhancement Commands / 8
Specialized Plot Commands / 8
Colors, Symbols and Line Types / 9
Three-Dimensional Plotting Commands / 9
Histogram Functions / 9

MATLAB Commands – 1
Programming
Logical and Relational Operators / 10
Program Flow Control / 10
Logical Functions / 10
M-Files / 11
Timing /11

Mathematical Functions
Exponential and Logarithmic Functions / 12
Trigonometric Functions / 12
Hyperbolic Functions / 12
Complex Functions / 13
Statistical Functions / 13
Random Number Functions / 13
Numeric Functions / 13
String Functions / 13

Numerical Methods
Polynomial and Regression Functions / 14
Interpolation Functions / 14
Numerical Integration Functions / 14
Numerical Differentiation Functions / 14
ODE Solvers / 15
Predefined Input Functions / 15

Symbolic Math Toolbox
Functions for Creating and Evaluating Symbolic Expressions / 16
Functions for Manipulating Symbolic Expressions / 16
Symbolic Calculus Functions / 16
Symbolic Solution of Algebraic and Transcendental Equations / 17
Symbolic Solution of Differential Equations / 17
Laplace Transform Functions / 17
Symbolic Linear Algebra Functions / 17

MATLAB Commands – 2
General Purpose Commands
Operators and Special Characters
+
*
.*
^
.^

/
.
./
:
( )
[ ]
.
…
,
;
%
_
._
=

Plus; addition operator.
Minus; subtraction operator.
Scalar and matrix multiplication operator.
Array multiplication operator.
Scalar and matrix exponentiation operator.
Array exponentiation operator.
Left-division operator.
Right-division operator.
Array left-division operator.
Array right-division operator.
Colon; generates regularly spaced elements and represents an entire row or column.
Parentheses; encloses function arguments and array indices; overrides precedence.
Brackets; enclosures array elements.
Decimal point.
Ellipsis; line-continuation operator.
Comma; separates statements and elements in a row.
Semicolon; separates columns and suppresses display.
Percent sign; designates a comment and specifies formatting.
Quote sign and transpose operator.
Nonconjugated transpose operator.
Assignment (replacement) operator.

Commands for Managing a Session
clc
clear
exist
global
help
lookfor
quit
who
whos

Clears Command window.
Removes variables from memory.
Checks for existence of file or variable.
Declares variables to be global.
Searches for a help topic.
Searches help entries for a keyword.
Stops MATLAB.
Lists current variables.
Lists current variables (long display).

MATLAB Commands – 3
Special Variables and Constants
ans
eps
i,j
Inf
NaN
pi

Most recent answer.
Accuracy of floating-point precision.
The imaginary unit - 1.
Infinity.
Undefined numerical result (not a number).
The number p .

System and File Commands
cd
date
delete
diary
dir
load
path
pwd
save
type
what
wklread

Changes current directory.
Displays current date.
Deletes a file.
Switches on/off diary file recording.
Lists all files in current directory.
Loads workspace variables from a file.
Displays search path.
Displays current directory.
Saves workspace variables in a file.
Displays contents of a file.
Lists all MATLAB files in the current directory.
Reads .wk1 spreadsheet file.

MATLAB Commands – 4
Input/Output and Formatting Commands
Input/Output Commands
disp
fscanf
format
fprintf
input
;

Displays contents of an array or string.
Read formatted data from a file.
Controls screen-display format.
Performs formatted writes to screen or file.
Displays prompts and waits for input.
Suppresses screen printing.

Format Codes for fprintf and fscanf
%s
%d
%f
%e
%g
n
t

Format as a string.
Format as an integer.
Format as a floating point value.
Format as a floating point value in scientific notation.
Format in the most compact form: %f or %e.
Insert a new line in the output string.
Insert a tab in the output string.

Numeric Display Formats
format
format
format
format
format
format
format
format
format

short
long
short e
long e
bank
+
rat
compact
loose

Four decimal digits (default).
16 decimal digits.
Five digits plus exponent.
16 digits plus exponents.
Two decimal digits.
Positive, negative, or zero.
Rational approximation.
Suppresses some line feeds.
Resets to less compact display mode.

MATLAB Commands – 5
Vector, Matrix and Array Commands
Array Commands
cat
find
length
linspace
logspace
max
min
prod
reshape
size
sort
sum

Concatenates arrays.
Finds indices of nonzero elements.
Computers number of elements.
Creates regularly spaced vector.
Creates logarithmically spaced vector.
Returns largest element.
Returns smallest element.
Product of each column.
Change size
Computes array size.
Sorts each column.
Sums each column.

Special Matrices
eye
ones
zeros

Creates an identity matrix.
Creates an array of ones.
Creates an array of zeros.

Matrix Arithmetic
cross
dot

Computes cross products.
Computes dot products.

Matrix Commands for Solving Linear Equations
det
inv
pinv
rank
rref

Computes determinant of an array.
Computes inverse of a matrix.
Computes pseudoinverse of a matrix.
Computes rank of a matrix.
Computes reduced row echelon form.

MATLAB Commands – 6
Cell Array Functions
cell
celldisp
cellplot
num2cell
deal
iscell

Creates cell array.
Displays cell array.
Displays graphical representation of cell array.
Converts numeric array to cell array.
Matches input and output lists.
Identifies cell array.

Structure Functions
fieldnames
getfield
isfield
isstruct
rmfield
setfield
struct

Returns field names in a structure array.
Returns field contents of a structure array.
Identifies a structure array field.
Identifies a structure array.
Removes a field from a structure array.
Sets contents of field.
Creates structure array.

MATLAB Commands – 7
Plotting Commands
Basic xy Plotting Commands
axis
fplot
grid
plot
print
title
xlabel
ylabel

Sets axis limits.
Intelligent plotting of functions.
Displays gridlines.
Generates xy plot.
Prints plot or saves plot to a file
Puts text at top of plot.
Adds text label to x-axis.
Adds text label to y-axis.

Plot Enhancement Commands
axes
close
close all
figure
gtext
hold
legend
refresh
set
subplot
text

Creates axes objects.
Closes the current plot.
Closes all plots.
Opens a new figure window.
Enables label placement by mouse.
Freezes current plot.
Legend placement by mouse.
Redraws current figure window.
Specifies properties of objects such as axes.
Creates plots in subwindows.
Places string in figure.

Specialized Plot Commands
bar
loglog
polar
semilogx
semilogy
stairs
stem

Creates bar chart.
Creates log-log plot.
Creates polar plot.
Creates semilog plot (logarithmic abscissa).
Creates semilog plot (logarithmic ordinate).
Creates stairs pot.
Creates stem plot.

MATLAB Commands – 8
Colors, Symbols and Line Types
Color
y
m
c
r
g
b
w
k

yellow
magenta
cyan
red
green
blue
white
black

Symbol
.
o
x
+
*
d
v
^
<
>
p
h

point
circle
x-mark
plus
star
diamond
triangle (down)
triangle (up)
triangle (left)
triangle (right)
pentagram
hexagram

Line
:
-.
--

solid
dotted
dash dotted
dashed

Three-Dimensional Plotting Commands
contour
mesh
meshc
meshz
plot3
surf
surfc
meshgrid
waterfall
zlabel

Creates contour plot.
Creates three-dimensional mesh surface plot.
Same as mesh with contour plot underneath.
Same as mesh with vertical lines underneath.
Creates three-dimensional plots from lines and points.
Creates shaded three-dimensional mesh surface plot.
Same as surf with contour plot underneath.
Creates rectangular grid.
Same as mesh with mesh lines in one direction.
Adds text label to z-axis.

Histogram Functions
bar
hist
histc

Creates a bar chart.
Aggregates the data into equally spaced bins.
Aggregates the data into unequally spaced bins.

MATLAB Commands – 9
Programming
Logical and Relational Operators
==
~=
<
<=
>
>=
&
|
~
xor

Relational operator: equal to.
Relational operator: not equal to.
Relational operator: less than.
Relational operator: less than or equal to.
Relational operator: greater than.
Relational operator: greater than or equal to.
Logical operator: AND.
Logical operator: OR.
Logical operator: NOT.
Logical operator: EXCLUSIVE OR.

Program Flow Control
break
case
else
elseif
end
error
for
if
otherwise
return
switch
warning
while

Terminates execution of a loop.
Provides alternate execution paths within switch structure.
Delineates alternate block of statements.
Conditionally executes statements.
Terminates for, while, and if statements.
Display error messages.
Repeats statements a specific number of times
Executes statements conditionally.
Default part of switch statement.
Return to the invoking function.
Directs program execution by comparing point with case expressions.
Display a warning message.
Repeats statements an indefinite number of times.

Logical Functions
any
all
find
finite
isnan
isinf
isempty
isreal

True if any elements are nonzero.
True if all elements are nonzero.
Finds indices of nonzero elements.
True if elements are finite.
True if elements are undefined.
True if elements are infinite.
True if matrix is empty.
True if all elements are real.

MATLAB Commands – 10
M-Files
eval
feval
function
global
nargin
nargout
script

Interpret strings containing Matlab expressions.
Function evaluation.
Creates a user-defined function M-file.
Define global variables.
Number of function input arguments.
Number of function output arguments.
Script M-files

Timing
cputime
clock
tic, toc

CPU time in seconds.
Current date and time as date vector.
Start, stop a stopwatch timer.

MATLAB Commands – 11
Mathematical Functions
Exponential and Logarithmic Functions
exp(x)
log(x)
log10(x)
sqrt(x)

Exponential; ex.
Natural logarithm; ln(x).
Common (base 10) logarithm; log(x)= log10(x).
Square root; x.

Trigonometric Functions
acos(x)
acot(x)
acsc(x)
asec(x)
asin(x)
atan(x)
atan2(y,x)
cos(x)
cot(x)
csc(x)
sec(x)
sin(x)
tan(x)

Inverse cosine; arcos x = cos –1 (x).
Inverse cotangent; arccot x = cot –1(x).
Inverse cosecant; arcs x = csc –1 (x).
Inverse secant; arcsec x = sec –1 (x).
Inverse sine; arcsin x = sin –1 (x).
Inverse tangent; arctan x = tan –1 (x).
Four-quadrant inverse tangent.
Cosine; cos(x).
Cotangent; cot(x).
Cosecant; csc(x).
Secant; sec(x).
Sine; sin(x).
Tangent; tan(x).

Hyperbolic Functions
acosh(x)
acoth(x)
acsch(x)
asech(x)
asinh(x)
atanh(x)
cosh(x)
coth(x)
csch(x)
sech(x)
sinh(x)
tanh(x)

Inverse hyperbolic cosine; cosh –1 (x).
Inverse hyperbolic cotangent; coth –1 (x).
Inverse hyperbolic cosecant; csch –1 (x).
Inverse hyperbolic secant; sech –1 (x).
Inverse hyperbolic sine; sinh –1 (x).
Inverse hyperbolic tangent; tanh –1 (x).
Hyperbolic cosine; cosh(x).
Hyperbolic cotangent; cosh(x)/sinh(x).
Hyperbolic cosecant; 1/sinh(x).
Hyperbolic secant; 1/cosh(x).
Hyperbolic sine; sinh(x).
Hyperbolic tangent; sinh(x)/cosh(x).

MATLAB Commands – 12
Complex Functions
abs(x)
angle(x)
conj(x)
imag(x)
real(x)

Absolute value; |x|.
Angle of a complex number x.
Complex conjugate of x.
Imaginary part of a complex number x.
Real part of a complex number x.

Statistical Functions
erf(x)
mean
median
std

Computes the error function erf (x).
Calculates the average.
Calculates the median.
Calculates the standard deviation.

Random Number Functions
rand
randn

Generates uniformly distributed random numbers between 0 and 1.
Generates normally distributed random numbers.

Numeric Functions
ceil
fix
floor
round
sign

Rounds to the nearest integer toward •.
Rounds to the nearest integer toward zero.
Rounds to the nearest integer toward - •.
Rounds towards the nearest integer.
Signum function.

String Functions
findstr
strcmp
char

Finds occurrences of a string.
Compares strings.
Creates character string array

MATLAB Commands – 13
Numerical Methods
Polynomial and Regression Functions
conv
deconv
eig
poly
polyfit
polyval
roots

Computes product of two polynomials
Computes ratio of polynomials.
Computes the eigenvalues of a matrix.
Computes polynomial from roots.
Fits a polynomial to data.
Evaluates polynomial and generates error estimates.
Computes polynomial roots.

Interpolation Functions
interp1
interp2
spline
unmkpp

Linear and cubic-spline interpolations of a function of one variable.
Linear interpolation of a function of two variables.
Cubic-spline interpolation.
Computes the coefficients of cubic-spine polynomials.

Root Finding and Minimization
fmin
fmins
fzero

Finds minimum of single-variable function.
Finds minimum of multivariable function.
Finds zero of single-variable function.

Numerical Integration Functions
quad
quadl
trapz

Numerical integration with adaptive Simpson’s rule.
Numerical integration with adaptive Lobatto quadrature.
Numerical integration with the trapezoidal rule.

Numerical Differentiation Functions
diff(x)
polyder

Computes the difference between adjacent elements in the vector x.
Differentiates a polynomial, a polynomial product, or a polynomial quotient.

MATLAB Commands – 14
ODE Solvers
ode23
ode45
ode113
ode23s
ode23t
ode23b
ode15s
odeset

Nonstiff, low-order solver.
Nonstiff, medium-order solver.
Nonstiff, variable-order solver.
Stiff, low-order.
Moderately stiff, trapezoidal rule solver.
Stiff, low-order solver.
Stiff, variable-order solver.
Creates integrator options structure for ODE solvers.

Predefined Input Functions
gensig
sawtooth
square
stepfun

Generates a periodic sine, square, or pulse input.
Generates a periodic sawtooth input.
Generates a square wave input.
Generates a step function input.

MATLAB Commands – 15
Symbolic Math Toolbox
Functions for Creating and Evaluating Symbolic Expressions
class
digits
double
ezplot
findsym
numden
sym
syms
vpa

Returns the class of an expression.
Sets the number of decimal digits used to do variable precision arithmetic.
Converts an expression to numeric form.
Generates a plot of a symbolic expression.
Finds the symbolic variables in a symbolic expression.
Returns the numerator and denominator of an expression.
Creates a symbolic variable.
Creates one or more symbolic variables.
Sets the number of digits used to evaluate expressions.

Functions for Manipulating Symbolic Expressions
collect
expand
factor
poly2sym
pretty
simple
simplify
subs
sym2poly

Collects coefficients of like powers in an expression.
Expands an expression by carrying out jpowers.
Factors an expression.
Converts a polynomial coefficient vector to a symbolic polynomial.
Displays an expression in a form that resembles typeset mathematics.
Searches for the shortest form of an expression.
Simplifies an expression using Maple’s simplification rules.
Substitutes variables or expressions.
Converts an expression to a polynomial coefficient vector.

Symbolic Calculus Functions
diff
Dirac
Heaviside
int
limit
symsum
taylor

Returns the derivative of an expression.
Dirac delta function (unit impulse).
Heaviside function (unit step).
Returns the integral of an expression.
Returns the limit of an expression.
Returns the symbolic summation of an expression.
Returns the Taylor series of a function.

MATLAB Commands – 16
Symbolic Solution of Algebraic and Transcendental Equations
solve

Solves symbolic equations.

Symbolic Solution of Differential Equations
dsolve

Returns a symbolic solution of a differential equation or set of equations.

Laplace Transform Functions
ilaplace
laplace

Returns the inverse Laplace transform.
Returns the Laplace transform.

Symbolic Linear Algebra Functions
det
eig
inv
poly

Returns the determinant of a matrix.
Returns the eigenvalues (characteristic roots) of a matrix.
Returns the inverse of a matrix.
Returns the characteristic polynomial of a matrix.

MATLAB Commands – 17

Mais conteúdo relacionado

Mais procurados

Espectro Ensanchado - Telecomunicaciones III
Espectro Ensanchado - Telecomunicaciones IIIEspectro Ensanchado - Telecomunicaciones III
Espectro Ensanchado - Telecomunicaciones IIIAndy Juan Sarango Veliz
 
Waveguides and its Types Field view and structures
Waveguides and its Types Field view and structuresWaveguides and its Types Field view and structures
Waveguides and its Types Field view and structuresAvishishtKumar
 
Signal Processing Introduction using Fourier Transforms
Signal Processing Introduction using Fourier TransformsSignal Processing Introduction using Fourier Transforms
Signal Processing Introduction using Fourier TransformsArvind Devaraj
 
Digital Signal Processing[ECEG-3171]-Ch1_L02
Digital Signal Processing[ECEG-3171]-Ch1_L02Digital Signal Processing[ECEG-3171]-Ch1_L02
Digital Signal Processing[ECEG-3171]-Ch1_L02Rediet Moges
 
DSP_FOEHU - MATLAB 03 - The z-Transform
DSP_FOEHU - MATLAB 03 - The z-TransformDSP_FOEHU - MATLAB 03 - The z-Transform
DSP_FOEHU - MATLAB 03 - The z-TransformAmr E. Mohamed
 
Unit 1 Operation on signals
Unit 1  Operation on signalsUnit 1  Operation on signals
Unit 1 Operation on signalsDr.SHANTHI K.G
 
Meeting w4 chapter 2 part 2
Meeting w4   chapter 2 part 2Meeting w4   chapter 2 part 2
Meeting w4 chapter 2 part 2mkazree
 
Ordinary Differential Equations And Their Application: Modeling: Free Oscilla...
Ordinary Differential Equations And Their Application: Modeling: Free Oscilla...Ordinary Differential Equations And Their Application: Modeling: Free Oscilla...
Ordinary Differential Equations And Their Application: Modeling: Free Oscilla...jani parth
 
Fir filter design using Frequency sampling method
Fir filter design using Frequency sampling methodFir filter design using Frequency sampling method
Fir filter design using Frequency sampling methodSarang Joshi
 
MATLAB : Numerical Differention and Integration
MATLAB : Numerical Differention and IntegrationMATLAB : Numerical Differention and Integration
MATLAB : Numerical Differention and IntegrationAinul Islam
 
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidFourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidXavier Davias
 
presentation on digital signal processing
presentation on digital signal processingpresentation on digital signal processing
presentation on digital signal processingsandhya jois
 

Mais procurados (20)

Convolution
ConvolutionConvolution
Convolution
 
Espectro Ensanchado - Telecomunicaciones III
Espectro Ensanchado - Telecomunicaciones IIIEspectro Ensanchado - Telecomunicaciones III
Espectro Ensanchado - Telecomunicaciones III
 
Waveguides and its Types Field view and structures
Waveguides and its Types Field view and structuresWaveguides and its Types Field view and structures
Waveguides and its Types Field view and structures
 
Signal Processing Introduction using Fourier Transforms
Signal Processing Introduction using Fourier TransformsSignal Processing Introduction using Fourier Transforms
Signal Processing Introduction using Fourier Transforms
 
Decimation in Time
Decimation in TimeDecimation in Time
Decimation in Time
 
Digital Signal Processing[ECEG-3171]-Ch1_L02
Digital Signal Processing[ECEG-3171]-Ch1_L02Digital Signal Processing[ECEG-3171]-Ch1_L02
Digital Signal Processing[ECEG-3171]-Ch1_L02
 
DSP_FOEHU - MATLAB 03 - The z-Transform
DSP_FOEHU - MATLAB 03 - The z-TransformDSP_FOEHU - MATLAB 03 - The z-Transform
DSP_FOEHU - MATLAB 03 - The z-Transform
 
Unit 1 Operation on signals
Unit 1  Operation on signalsUnit 1  Operation on signals
Unit 1 Operation on signals
 
Chapter5
Chapter5Chapter5
Chapter5
 
Meeting w4 chapter 2 part 2
Meeting w4   chapter 2 part 2Meeting w4   chapter 2 part 2
Meeting w4 chapter 2 part 2
 
Ordinary Differential Equations And Their Application: Modeling: Free Oscilla...
Ordinary Differential Equations And Their Application: Modeling: Free Oscilla...Ordinary Differential Equations And Their Application: Modeling: Free Oscilla...
Ordinary Differential Equations And Their Application: Modeling: Free Oscilla...
 
Fir filter design using Frequency sampling method
Fir filter design using Frequency sampling methodFir filter design using Frequency sampling method
Fir filter design using Frequency sampling method
 
Chap04
Chap04Chap04
Chap04
 
MATLAB : Numerical Differention and Integration
MATLAB : Numerical Differention and IntegrationMATLAB : Numerical Differention and Integration
MATLAB : Numerical Differention and Integration
 
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidFourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
 
convolution
convolutionconvolution
convolution
 
Modulo 3
Modulo 3Modulo 3
Modulo 3
 
MIMO.ppt (2) 2
MIMO.ppt (2) 2MIMO.ppt (2) 2
MIMO.ppt (2) 2
 
Bch codes
Bch codesBch codes
Bch codes
 
presentation on digital signal processing
presentation on digital signal processingpresentation on digital signal processing
presentation on digital signal processing
 

Semelhante a Matlab commands

Semelhante a Matlab commands (20)

Matlab commands
Matlab commandsMatlab commands
Matlab commands
 
Matlab commands
Matlab commandsMatlab commands
Matlab commands
 
matlab-130408153714-phpapp02_lab123.ppsx
matlab-130408153714-phpapp02_lab123.ppsxmatlab-130408153714-phpapp02_lab123.ppsx
matlab-130408153714-phpapp02_lab123.ppsx
 
Matlab basic and image
Matlab basic and imageMatlab basic and image
Matlab basic and image
 
Brief Introduction to Matlab
Brief  Introduction to MatlabBrief  Introduction to Matlab
Brief Introduction to Matlab
 
Matlab ppt
Matlab pptMatlab ppt
Matlab ppt
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
 
Introduction to Matlab.ppt
Introduction to Matlab.pptIntroduction to Matlab.ppt
Introduction to Matlab.ppt
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
MatlabIntro (1).ppt
MatlabIntro (1).pptMatlabIntro (1).ppt
MatlabIntro (1).ppt
 
Introduction to matlab lecture 1 of 4
Introduction to matlab lecture 1 of 4Introduction to matlab lecture 1 of 4
Introduction to matlab lecture 1 of 4
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
 
MATLAB Programming
MATLAB Programming MATLAB Programming
MATLAB Programming
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginners
 

Mais de Tarun Gehlot

Materials 11-01228
Materials 11-01228Materials 11-01228
Materials 11-01228Tarun Gehlot
 
Continuity and end_behavior
Continuity and  end_behaviorContinuity and  end_behavior
Continuity and end_behaviorTarun Gehlot
 
Continuity of functions by graph (exercises with detailed solutions)
Continuity of functions by graph   (exercises with detailed solutions)Continuity of functions by graph   (exercises with detailed solutions)
Continuity of functions by graph (exercises with detailed solutions)Tarun Gehlot
 
Factoring by the trial and-error method
Factoring by the trial and-error methodFactoring by the trial and-error method
Factoring by the trial and-error methodTarun Gehlot
 
Introduction to finite element analysis
Introduction to finite element analysisIntroduction to finite element analysis
Introduction to finite element analysisTarun Gehlot
 
Finite elements : basis functions
Finite elements : basis functionsFinite elements : basis functions
Finite elements : basis functionsTarun Gehlot
 
Finite elements for 2‐d problems
Finite elements  for 2‐d problemsFinite elements  for 2‐d problems
Finite elements for 2‐d problemsTarun Gehlot
 
Error analysis statistics
Error analysis   statisticsError analysis   statistics
Error analysis statisticsTarun Gehlot
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabTarun Gehlot
 
Linear approximations and_differentials
Linear approximations and_differentialsLinear approximations and_differentials
Linear approximations and_differentialsTarun Gehlot
 
Local linear approximation
Local linear approximationLocal linear approximation
Local linear approximationTarun Gehlot
 
Interpolation functions
Interpolation functionsInterpolation functions
Interpolation functionsTarun Gehlot
 
Propeties of-triangles
Propeties of-trianglesPropeties of-triangles
Propeties of-trianglesTarun Gehlot
 
Gaussian quadratures
Gaussian quadraturesGaussian quadratures
Gaussian quadraturesTarun Gehlot
 
Basics of set theory
Basics of set theoryBasics of set theory
Basics of set theoryTarun Gehlot
 
Numerical integration
Numerical integrationNumerical integration
Numerical integrationTarun Gehlot
 
Applications of set theory
Applications of  set theoryApplications of  set theory
Applications of set theoryTarun Gehlot
 
Miscellneous functions
Miscellneous  functionsMiscellneous  functions
Miscellneous functionsTarun Gehlot
 
Dependent v. independent variables
Dependent v. independent variablesDependent v. independent variables
Dependent v. independent variablesTarun Gehlot
 

Mais de Tarun Gehlot (20)

Materials 11-01228
Materials 11-01228Materials 11-01228
Materials 11-01228
 
Binary relations
Binary relationsBinary relations
Binary relations
 
Continuity and end_behavior
Continuity and  end_behaviorContinuity and  end_behavior
Continuity and end_behavior
 
Continuity of functions by graph (exercises with detailed solutions)
Continuity of functions by graph   (exercises with detailed solutions)Continuity of functions by graph   (exercises with detailed solutions)
Continuity of functions by graph (exercises with detailed solutions)
 
Factoring by the trial and-error method
Factoring by the trial and-error methodFactoring by the trial and-error method
Factoring by the trial and-error method
 
Introduction to finite element analysis
Introduction to finite element analysisIntroduction to finite element analysis
Introduction to finite element analysis
 
Finite elements : basis functions
Finite elements : basis functionsFinite elements : basis functions
Finite elements : basis functions
 
Finite elements for 2‐d problems
Finite elements  for 2‐d problemsFinite elements  for 2‐d problems
Finite elements for 2‐d problems
 
Error analysis statistics
Error analysis   statisticsError analysis   statistics
Error analysis statistics
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Linear approximations and_differentials
Linear approximations and_differentialsLinear approximations and_differentials
Linear approximations and_differentials
 
Local linear approximation
Local linear approximationLocal linear approximation
Local linear approximation
 
Interpolation functions
Interpolation functionsInterpolation functions
Interpolation functions
 
Propeties of-triangles
Propeties of-trianglesPropeties of-triangles
Propeties of-triangles
 
Gaussian quadratures
Gaussian quadraturesGaussian quadratures
Gaussian quadratures
 
Basics of set theory
Basics of set theoryBasics of set theory
Basics of set theory
 
Numerical integration
Numerical integrationNumerical integration
Numerical integration
 
Applications of set theory
Applications of  set theoryApplications of  set theory
Applications of set theory
 
Miscellneous functions
Miscellneous  functionsMiscellneous  functions
Miscellneous functions
 
Dependent v. independent variables
Dependent v. independent variablesDependent v. independent variables
Dependent v. independent variables
 

Último

ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 

Último (20)

ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 

Matlab commands

  • 1. MATLAB Commands and Functions Dr. Brian Vick Mechanical Engineering Department Virginia Tech General Purpose Commands Operators and Special Characters / 3 Commands for Managing a Session / 3 Special Variables and Constants / 4 System and File Commands / 4 Input/Output and Formatting Commands Input/Output Commands / 5 Format Codes for fprintf and fscanf / 5 Numeric Display Formats / 5 Vector, Matrix and Array Commands Array Commands / 6 Special Matrices / 6 Matrix Arithmetic / 6 Matrix Commands for Solving Linear Equations / 6 Cell Array Functions / 7 Structure Functions / 7 Plotting Commands Basic xy Plotting Commands / 8 Plot Enhancement Commands / 8 Specialized Plot Commands / 8 Colors, Symbols and Line Types / 9 Three-Dimensional Plotting Commands / 9 Histogram Functions / 9 MATLAB Commands – 1
  • 2. Programming Logical and Relational Operators / 10 Program Flow Control / 10 Logical Functions / 10 M-Files / 11 Timing /11 Mathematical Functions Exponential and Logarithmic Functions / 12 Trigonometric Functions / 12 Hyperbolic Functions / 12 Complex Functions / 13 Statistical Functions / 13 Random Number Functions / 13 Numeric Functions / 13 String Functions / 13 Numerical Methods Polynomial and Regression Functions / 14 Interpolation Functions / 14 Numerical Integration Functions / 14 Numerical Differentiation Functions / 14 ODE Solvers / 15 Predefined Input Functions / 15 Symbolic Math Toolbox Functions for Creating and Evaluating Symbolic Expressions / 16 Functions for Manipulating Symbolic Expressions / 16 Symbolic Calculus Functions / 16 Symbolic Solution of Algebraic and Transcendental Equations / 17 Symbolic Solution of Differential Equations / 17 Laplace Transform Functions / 17 Symbolic Linear Algebra Functions / 17 MATLAB Commands – 2
  • 3. General Purpose Commands Operators and Special Characters + * .* ^ .^ / . ./ : ( ) [ ] . … , ; % _ ._ = Plus; addition operator. Minus; subtraction operator. Scalar and matrix multiplication operator. Array multiplication operator. Scalar and matrix exponentiation operator. Array exponentiation operator. Left-division operator. Right-division operator. Array left-division operator. Array right-division operator. Colon; generates regularly spaced elements and represents an entire row or column. Parentheses; encloses function arguments and array indices; overrides precedence. Brackets; enclosures array elements. Decimal point. Ellipsis; line-continuation operator. Comma; separates statements and elements in a row. Semicolon; separates columns and suppresses display. Percent sign; designates a comment and specifies formatting. Quote sign and transpose operator. Nonconjugated transpose operator. Assignment (replacement) operator. Commands for Managing a Session clc clear exist global help lookfor quit who whos Clears Command window. Removes variables from memory. Checks for existence of file or variable. Declares variables to be global. Searches for a help topic. Searches help entries for a keyword. Stops MATLAB. Lists current variables. Lists current variables (long display). MATLAB Commands – 3
  • 4. Special Variables and Constants ans eps i,j Inf NaN pi Most recent answer. Accuracy of floating-point precision. The imaginary unit - 1. Infinity. Undefined numerical result (not a number). The number p . System and File Commands cd date delete diary dir load path pwd save type what wklread Changes current directory. Displays current date. Deletes a file. Switches on/off diary file recording. Lists all files in current directory. Loads workspace variables from a file. Displays search path. Displays current directory. Saves workspace variables in a file. Displays contents of a file. Lists all MATLAB files in the current directory. Reads .wk1 spreadsheet file. MATLAB Commands – 4
  • 5. Input/Output and Formatting Commands Input/Output Commands disp fscanf format fprintf input ; Displays contents of an array or string. Read formatted data from a file. Controls screen-display format. Performs formatted writes to screen or file. Displays prompts and waits for input. Suppresses screen printing. Format Codes for fprintf and fscanf %s %d %f %e %g n t Format as a string. Format as an integer. Format as a floating point value. Format as a floating point value in scientific notation. Format in the most compact form: %f or %e. Insert a new line in the output string. Insert a tab in the output string. Numeric Display Formats format format format format format format format format format short long short e long e bank + rat compact loose Four decimal digits (default). 16 decimal digits. Five digits plus exponent. 16 digits plus exponents. Two decimal digits. Positive, negative, or zero. Rational approximation. Suppresses some line feeds. Resets to less compact display mode. MATLAB Commands – 5
  • 6. Vector, Matrix and Array Commands Array Commands cat find length linspace logspace max min prod reshape size sort sum Concatenates arrays. Finds indices of nonzero elements. Computers number of elements. Creates regularly spaced vector. Creates logarithmically spaced vector. Returns largest element. Returns smallest element. Product of each column. Change size Computes array size. Sorts each column. Sums each column. Special Matrices eye ones zeros Creates an identity matrix. Creates an array of ones. Creates an array of zeros. Matrix Arithmetic cross dot Computes cross products. Computes dot products. Matrix Commands for Solving Linear Equations det inv pinv rank rref Computes determinant of an array. Computes inverse of a matrix. Computes pseudoinverse of a matrix. Computes rank of a matrix. Computes reduced row echelon form. MATLAB Commands – 6
  • 7. Cell Array Functions cell celldisp cellplot num2cell deal iscell Creates cell array. Displays cell array. Displays graphical representation of cell array. Converts numeric array to cell array. Matches input and output lists. Identifies cell array. Structure Functions fieldnames getfield isfield isstruct rmfield setfield struct Returns field names in a structure array. Returns field contents of a structure array. Identifies a structure array field. Identifies a structure array. Removes a field from a structure array. Sets contents of field. Creates structure array. MATLAB Commands – 7
  • 8. Plotting Commands Basic xy Plotting Commands axis fplot grid plot print title xlabel ylabel Sets axis limits. Intelligent plotting of functions. Displays gridlines. Generates xy plot. Prints plot or saves plot to a file Puts text at top of plot. Adds text label to x-axis. Adds text label to y-axis. Plot Enhancement Commands axes close close all figure gtext hold legend refresh set subplot text Creates axes objects. Closes the current plot. Closes all plots. Opens a new figure window. Enables label placement by mouse. Freezes current plot. Legend placement by mouse. Redraws current figure window. Specifies properties of objects such as axes. Creates plots in subwindows. Places string in figure. Specialized Plot Commands bar loglog polar semilogx semilogy stairs stem Creates bar chart. Creates log-log plot. Creates polar plot. Creates semilog plot (logarithmic abscissa). Creates semilog plot (logarithmic ordinate). Creates stairs pot. Creates stem plot. MATLAB Commands – 8
  • 9. Colors, Symbols and Line Types Color y m c r g b w k yellow magenta cyan red green blue white black Symbol . o x + * d v ^ < > p h point circle x-mark plus star diamond triangle (down) triangle (up) triangle (left) triangle (right) pentagram hexagram Line : -. -- solid dotted dash dotted dashed Three-Dimensional Plotting Commands contour mesh meshc meshz plot3 surf surfc meshgrid waterfall zlabel Creates contour plot. Creates three-dimensional mesh surface plot. Same as mesh with contour plot underneath. Same as mesh with vertical lines underneath. Creates three-dimensional plots from lines and points. Creates shaded three-dimensional mesh surface plot. Same as surf with contour plot underneath. Creates rectangular grid. Same as mesh with mesh lines in one direction. Adds text label to z-axis. Histogram Functions bar hist histc Creates a bar chart. Aggregates the data into equally spaced bins. Aggregates the data into unequally spaced bins. MATLAB Commands – 9
  • 10. Programming Logical and Relational Operators == ~= < <= > >= & | ~ xor Relational operator: equal to. Relational operator: not equal to. Relational operator: less than. Relational operator: less than or equal to. Relational operator: greater than. Relational operator: greater than or equal to. Logical operator: AND. Logical operator: OR. Logical operator: NOT. Logical operator: EXCLUSIVE OR. Program Flow Control break case else elseif end error for if otherwise return switch warning while Terminates execution of a loop. Provides alternate execution paths within switch structure. Delineates alternate block of statements. Conditionally executes statements. Terminates for, while, and if statements. Display error messages. Repeats statements a specific number of times Executes statements conditionally. Default part of switch statement. Return to the invoking function. Directs program execution by comparing point with case expressions. Display a warning message. Repeats statements an indefinite number of times. Logical Functions any all find finite isnan isinf isempty isreal True if any elements are nonzero. True if all elements are nonzero. Finds indices of nonzero elements. True if elements are finite. True if elements are undefined. True if elements are infinite. True if matrix is empty. True if all elements are real. MATLAB Commands – 10
  • 11. M-Files eval feval function global nargin nargout script Interpret strings containing Matlab expressions. Function evaluation. Creates a user-defined function M-file. Define global variables. Number of function input arguments. Number of function output arguments. Script M-files Timing cputime clock tic, toc CPU time in seconds. Current date and time as date vector. Start, stop a stopwatch timer. MATLAB Commands – 11
  • 12. Mathematical Functions Exponential and Logarithmic Functions exp(x) log(x) log10(x) sqrt(x) Exponential; ex. Natural logarithm; ln(x). Common (base 10) logarithm; log(x)= log10(x). Square root; x. Trigonometric Functions acos(x) acot(x) acsc(x) asec(x) asin(x) atan(x) atan2(y,x) cos(x) cot(x) csc(x) sec(x) sin(x) tan(x) Inverse cosine; arcos x = cos –1 (x). Inverse cotangent; arccot x = cot –1(x). Inverse cosecant; arcs x = csc –1 (x). Inverse secant; arcsec x = sec –1 (x). Inverse sine; arcsin x = sin –1 (x). Inverse tangent; arctan x = tan –1 (x). Four-quadrant inverse tangent. Cosine; cos(x). Cotangent; cot(x). Cosecant; csc(x). Secant; sec(x). Sine; sin(x). Tangent; tan(x). Hyperbolic Functions acosh(x) acoth(x) acsch(x) asech(x) asinh(x) atanh(x) cosh(x) coth(x) csch(x) sech(x) sinh(x) tanh(x) Inverse hyperbolic cosine; cosh –1 (x). Inverse hyperbolic cotangent; coth –1 (x). Inverse hyperbolic cosecant; csch –1 (x). Inverse hyperbolic secant; sech –1 (x). Inverse hyperbolic sine; sinh –1 (x). Inverse hyperbolic tangent; tanh –1 (x). Hyperbolic cosine; cosh(x). Hyperbolic cotangent; cosh(x)/sinh(x). Hyperbolic cosecant; 1/sinh(x). Hyperbolic secant; 1/cosh(x). Hyperbolic sine; sinh(x). Hyperbolic tangent; sinh(x)/cosh(x). MATLAB Commands – 12
  • 13. Complex Functions abs(x) angle(x) conj(x) imag(x) real(x) Absolute value; |x|. Angle of a complex number x. Complex conjugate of x. Imaginary part of a complex number x. Real part of a complex number x. Statistical Functions erf(x) mean median std Computes the error function erf (x). Calculates the average. Calculates the median. Calculates the standard deviation. Random Number Functions rand randn Generates uniformly distributed random numbers between 0 and 1. Generates normally distributed random numbers. Numeric Functions ceil fix floor round sign Rounds to the nearest integer toward •. Rounds to the nearest integer toward zero. Rounds to the nearest integer toward - •. Rounds towards the nearest integer. Signum function. String Functions findstr strcmp char Finds occurrences of a string. Compares strings. Creates character string array MATLAB Commands – 13
  • 14. Numerical Methods Polynomial and Regression Functions conv deconv eig poly polyfit polyval roots Computes product of two polynomials Computes ratio of polynomials. Computes the eigenvalues of a matrix. Computes polynomial from roots. Fits a polynomial to data. Evaluates polynomial and generates error estimates. Computes polynomial roots. Interpolation Functions interp1 interp2 spline unmkpp Linear and cubic-spline interpolations of a function of one variable. Linear interpolation of a function of two variables. Cubic-spline interpolation. Computes the coefficients of cubic-spine polynomials. Root Finding and Minimization fmin fmins fzero Finds minimum of single-variable function. Finds minimum of multivariable function. Finds zero of single-variable function. Numerical Integration Functions quad quadl trapz Numerical integration with adaptive Simpson’s rule. Numerical integration with adaptive Lobatto quadrature. Numerical integration with the trapezoidal rule. Numerical Differentiation Functions diff(x) polyder Computes the difference between adjacent elements in the vector x. Differentiates a polynomial, a polynomial product, or a polynomial quotient. MATLAB Commands – 14
  • 15. ODE Solvers ode23 ode45 ode113 ode23s ode23t ode23b ode15s odeset Nonstiff, low-order solver. Nonstiff, medium-order solver. Nonstiff, variable-order solver. Stiff, low-order. Moderately stiff, trapezoidal rule solver. Stiff, low-order solver. Stiff, variable-order solver. Creates integrator options structure for ODE solvers. Predefined Input Functions gensig sawtooth square stepfun Generates a periodic sine, square, or pulse input. Generates a periodic sawtooth input. Generates a square wave input. Generates a step function input. MATLAB Commands – 15
  • 16. Symbolic Math Toolbox Functions for Creating and Evaluating Symbolic Expressions class digits double ezplot findsym numden sym syms vpa Returns the class of an expression. Sets the number of decimal digits used to do variable precision arithmetic. Converts an expression to numeric form. Generates a plot of a symbolic expression. Finds the symbolic variables in a symbolic expression. Returns the numerator and denominator of an expression. Creates a symbolic variable. Creates one or more symbolic variables. Sets the number of digits used to evaluate expressions. Functions for Manipulating Symbolic Expressions collect expand factor poly2sym pretty simple simplify subs sym2poly Collects coefficients of like powers in an expression. Expands an expression by carrying out jpowers. Factors an expression. Converts a polynomial coefficient vector to a symbolic polynomial. Displays an expression in a form that resembles typeset mathematics. Searches for the shortest form of an expression. Simplifies an expression using Maple’s simplification rules. Substitutes variables or expressions. Converts an expression to a polynomial coefficient vector. Symbolic Calculus Functions diff Dirac Heaviside int limit symsum taylor Returns the derivative of an expression. Dirac delta function (unit impulse). Heaviside function (unit step). Returns the integral of an expression. Returns the limit of an expression. Returns the symbolic summation of an expression. Returns the Taylor series of a function. MATLAB Commands – 16
  • 17. Symbolic Solution of Algebraic and Transcendental Equations solve Solves symbolic equations. Symbolic Solution of Differential Equations dsolve Returns a symbolic solution of a differential equation or set of equations. Laplace Transform Functions ilaplace laplace Returns the inverse Laplace transform. Returns the Laplace transform. Symbolic Linear Algebra Functions det eig inv poly Returns the determinant of a matrix. Returns the eigenvalues (characteristic roots) of a matrix. Returns the inverse of a matrix. Returns the characteristic polynomial of a matrix. MATLAB Commands – 17