Learn R Programming

⚠️There's a newer version (1.9.9) of this package.Take me there.

pracma (version 1.4.5)

Practical Numerical Math Functions

Description

Functions from numerical analysis and linear algebra, numerical optimization, differential equations, plus some special functions. Uses Matlab function names where appropriate to simplify porting.

Copy Link

Version

Install

install.packages('pracma')

Monthly Downloads

108,124

Version

1.4.5

License

GPL (>= 3)

Maintainer

Last Published

March 25th, 2013

Functions in pracma (1.4.5)

broyden

Broyden's Method
conv

Polynomial Convolution
erf

Error Functions and Inverses (Matlab Style)
eig

Eigenvalue Function (Matlab Style)
fletcher-powell

Davidon-Fletcher-Powell Method
findintervals

Find Interval Indices
hilb

Hilbert Matrix
fplot

Plot Multivariate Function
histc

Histogram Count (Matlab style)
hurst

Hurst Exponent
akimaInterp

Univariate Akima Interpolation
cart2sph

Coordinate Transformations
clear, who(s), ver

Clear function (Matlab style)
chebCoeff

Chebyshev Polynomials
dblquad

Double and Triple Integration
detrend

Remove Linear Trends
deval

Evaluate ODE Solution
errorbar

Plot Error Bars
findmins

Find All Minima
hessian

Hessian Matrix
abm3pc

Adams-Bashford-Moulton
blkdiag

Block Diagonal Matrix
disp,beep

Utility functions (Matlab style)
barylag

Barycentric Lagrange Interpolation
agmean

Arithmetic-geometric Mean
laguerre

Laguerre's Method
blanks

String of Blank Carakters
accumarray

Accumulate Vector Elements
brown72

Brownian Motion
bisect

Rootfinding Through Bisection
gaussLegendre

Gauss-Legendre Quadrature Formula
isprime

isprime Property
complexstep

Complex Step Derivation
hypot

Hypotenuse Function
compan

Companion Matrix
cond

Matrix Condition
jacobian

Jacobian Matrix
coth,csch,sech, etc.

More Hyperbolic Functions
charpoly

Characteristic Polynomial
logspace

Log-linearly Spaced Sequences
lsqnonlin

Nonlinear Least-Squares Fitting
nelder_mead

Nelder-Mead Minimization Method
newtonInterp

Lagrange and Newtons Interpolation
clenshaw_curtis

Clenshaw-Curtis Quadrature Formula
chebPoly

Chebyshev Polynomials
deconv

Deconvolution
magic

Magic Square
mod, rem

Integer Division
nchoosek

Binomial Coefficients
nullspace

Kernel or Nullspace
ndims

Number of Dimensions
pinv

Pseudoinverse or Generalized Inverse
curvefit

Parametric Curve Fit
eigjacobi

Jacobi Eigenvalue Method
polyarea

Area of a Polygon
numderiv

Richardson's Numerical Derivative
ezplot

Easy Function Plot
ppval

Piecewise Polynomial Structures
fnorm

Function Norm
qrSolve

LSE Solution
fzsolve

Complex Root Finding
cotes

Newton-Cotes Formulas
distmat

Distance Matrix
crossn

n-dimensional Vector Cross Product
ezcontour,ezmesh

Contour and Mesh Plotter
lsqlin

Linear Least-Squares Fitting
linspace

Linearly Spaced Sequences
euler_heun

Euler-Heun ODE Solver
ellipke,ellipj

Elliptic and Jacobi Elliptic Integrals
direct1d

Univariate Global Optimization
dot

Scalar Product
cranknic

Crank-Nicolson Method
eta

Dirichlet Eta Function
expm

Matrix Exponential
regexp

Match regular expression
fminbnd

Finding Function Minimum
rat

Continuous Fractions (Matlab Style)
rk4, rk4sys

Classical Runge-Kutta
randcomb

Random Combination
finds

find function (Matlab Style)
fminsearch

Minimum Finding
factors

Prime Factors
pascal

Pascal Triangle
Rank

Matrix Rank
muller

Muller's Method
flipdim

Matrix Flipping (Matlab Style)
nthroot

Real nth Root
Norm

Vector Norm
normest

Estimated Matrix Norm
and, or

Logical AND, OR (Matlab Style)
gaussNewton

Gauss-Newton Function Minimization
polyfit

Fitting by Polynomial
rkf54

Runge-Kutta-Fehlberg
taylor

Taylor Series Approximation
polyApprox

Polynomial Approximation
aitken

Aitken' Method
Toeplitz

Toeplitz Matrix
brent_dekker

Brent-Dekker Root Finding Method
polyadd

Adding Polynomials
fzero

Root Finding
gauss_kronrod

Gauss-Kronrod Quadrature
barylag2d

2-D Barycentric Lagrange Interpolation
ppfit

Piecewise Polynomial Fit
circlefit

Fitting a Circle
quadgk

Adaptive Gauss-Kronrod Quadrature
deg2rad

Degrees to Radians
gammaz

Complex Gamma Function
quadv

Vectorized Integration
pow2

Base 2 Power
quad2d

2-d Gaussian Quadrature
quadinf

Infinite Integrals
quadgr

Gaussian Quadrature with Richardson Extrapolation
quiver

Quiver or Velocity Plot
cross

Vector Cross Product
rmserr

Accuracy Measures
gramSchmidt

Gram-Schmidt
einsteinF

Einstein Functions
repmat

Replicate Matrix
segm_intersect

Segment Intersection
Diag

Matrix Diagonal
fact

Factorial Function
horner

Horner's Rule
gammainc

Incomplete Gamma Function
givens

Givens Rotation
gaussLaguerre

Gauss-Laguerre Quadrature Formula
grad

Numerical Gradient
inpolygon

Polygon Region
hadamard

Hadamard Matrix
strjust

Justify character vector
invperm

Inverse Permutation
gradient

Discrete Gradient (Matlab Style)
rot90

Matrix Rotation
hooke-jeeves

Hooke-Jeeves Method
sqrtm,rootm

Matrix Square and p-th Roots
invlap

Inverse Laplacian
hampel

Hampel Filter
kron

Kronecker product (Matlab Style)
lambertWp

Lambert's W Function
titanium

Titanium Test Data
itersolve

Iterative Methods
str2num

Converting string to number (Matlab style)
Mode

Mode function (Matlab style)
subspace

Angle between two subspaces
strTrim

Remove leading and trailing white space.
newtonsys

Newton Method for Nonlinear Systems
piecewise

Piecewise Linear Function
trapz

Trapezoidal Integration
gaussHermite

Gauss-Hermite Quadrature Formula
Trace

Matrix trace
ezpolar

Easy Polar Plot
segm_distance

Segment Distance
laplacian

Laplacian Operator
hausdorff_dist

Hausdorff Distance
integral2

Numerically Evaluate Double and Triple Integrals
interp2

Two-dimensional Data Interpolation
linprog

Linear Programming Solver
ifft

Inverse Fast Fourier Transformation
kmeanspp

K-means++ Clustering
pade

Pade Approximation
poly2str

Print Polynomial
interp1

One-dimensional Interpolation
plotyy

Plotting Two y-Axes
lu

LU Matrix Factorization
geomean, harmmean

Geometric and Harmonic Mean (Matlab Style)
mexpfit

Multi-exponential Fitting
polyint

Anti-derivative of Polynomial
newmark

Newmark Method
pltcross

Plotting Crosses
Poly

Define Polynomial by Roots
orth

Range Space
polymul

Multiplying Polynomials
polyval

Evaluating a Polynomial
ridders

Ridders' Method
sorting

Sorting Routines
spinterp

Monotone (Shape-Preserving) Interpolation
ratinterp

Rational Interpolation
pchip

Hermitean Interpolation Polynomials
size

Size of Matrix
procrustes

Solving the Procrustes Problem
Reshape

Reshape Matrix
steepest_descent

Steepest Descent
rosser

Rosser Matrix
regexprep

Replace string using regular expression
refindall

Find overlapping regular expression matches.
roots

Polynomial Roots
tri

Triangular Matrices (Matlab Style)
simpadpt

Adaptive Simpson Quadrature
runge

Runge Function
semilogx,semilogy

Semi-logarithmic Plots (Matlab Style)
squareform

Format Distance Matrix (Matlab Style)
strcmp

String Comparison
rortho

Generate Random Orthogogonal Matrix
strfind

Find Substrings
tic,toc

MATLAB timer functions
softline

Soft (Inexact) Line Search
strcat

String Concatenation
pracma-package

Practical Numerical Math Routines
std_err

Standard Error
trigPoly

Trigonometric Polynomial
strrep

Find and replace substring
vander

Vandermonde matrix
triquad

Gaussian Triangle Quadrature
primes

Prime Numbers
cot,csc,sec, etc.

More Trigonometric Functions
zeta

Riemann Zeta Function
vectorfield

Vector Field Plotting
wilkinson

wilkinson Matrix
whittaker

Whittaker Smoothing
angle

Basic Complex Functions
ceil

Integer Functions (Matlab Style)
cutpoints

Find Cutting Points
combs

Generate Combinations
cd, pwd, what

Directory Functions (Matlab style)
approx_entropy

Approximate Entropy
deeve

Event Detection in ODE solution
fresnelS/C

Fresnel Integrals
findpeaks

Find Peaks
fornberg

Fornberg's Finite Difference Approximation
fsolve

Solve System of Nonlinear Equations
fibsearch

Fibonacci Search
gcd, lcm

GCD and LCM Integer Functions
humps

Matlab Test Functions
integral

Adaptive Numerical Integration
mldivide

Matlab backslash operator
isempty

isempty Property
meshgrid

Generate a Mesh Grid
eye

Some Basic Matrices
moler

Moler Matrix
perms

Generate Permutations
newtonRaphson

Rootfinding through Newton-Raphson or Secant.
nnz

Nonzero Elements
polylog

Polylogarithm Function
ode23

Runge-Kutta
quadcc

Adaptive Clenshaw-Curtis Quadrature
randperm

Random Permutation
rand

Create Random Matrices
romberg

Romberg Integration
rosenbrock

Optimization Test Function
sigmoid

Sigmoid Function
trigApprox

Trigonometric Approximation
trisolve

Tridiagonal Linear System Solver
bsxfun

Elementwise Function Application (Matlab Style)
andrewsplot

Andrews' Curves
bvp

Boundary Value Problems
chebApprox

Chebyshev Approximation
cubicspline

Interpolating Cubic Spline
expint

Exponential and Logarithmic Integral
fderiv

Numerical Differentiation
figure

Control Plot Devices (Matlab Style)
golden_ratio

Golden Ratio Search
findzeros

Find All Roots
hankel

Hankel Matrix
householder

Householder Reflections
inv

Matrix Inverse (Matlab Style)
kriging

Interpolation by Kriging
lebesgue

Lebesgue Constant
neville

Neville's Method
matlab

Matlab Compatibility
nextpow2

Next Power of 2
movavg

Moving Average Filters
newtonHorner

Newton's Root Finding Method for Polynomials.
peaks

Peaks Function (Matlab Style)
numel

Number of Elements
polar

Polar Coordinate Plot (Matlab Style)
polypow

Polynomial Powers
polyder

Derivative of Polynomial
quad

Adaptive Simpson Quadrature
polytrans

Polynomial Transformation
quadl

Adaptive Lobatto Quadrature
rationalfit

Rational Function Approximation
rref

Reduced Row Echelon Form
simpson2d

Double Simpson Integration
std

Standard Deviation (Matlab Style)
sortrows

Sort Rows of a Matrix (Matlab Style)
savgol

Savitzky-Golay Smoothing