Learn R Programming

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

pracma (version 1.8.6)

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.8.6

License

GPL (>= 3)

Maintainer

Last Published

July 14th, 2015

Functions in pracma (1.8.6)

blanks

String of Blank Carakters
brown72

Brownian Motion
compan

Companion Matrix
deg2rad

Degrees to Radians
disp,beep

Utility functions (Matlab style)
cranknic

Crank-Nicolson Method
detrend

Remove Linear Trends
cutpoints

Find Cutting Points
fminsearch

Minimum Finding
fletcher-powell

Davidon-Fletcher-Powell Method
fzsolve

Complex Root Finding
gaussHermite

Gauss-Hermite Quadrature Formula
geo_median

Geometric Median
grad

Numerical Gradient
hooke_jeeves

Hooke-Jeeves Minimization Method
hurstexp

Hurst Exponent
isprime

isprime Property
interp2

Two-dimensional Data Interpolation
lu

LU Matrix Factorization
magic

Magic Square
nchoosek

Binomial Coefficients
jacobian

Jacobian Matrix
piecewise

Piecewise Linear Function
Poly

Define Polynomial by Roots
polyder

Derivative of Polynomial
polypow

Polynomial Powers
quad2d

2-d Gaussian Quadrature
quadcc

Adaptive Clenshaw-Curtis Quadrature
rationalfit

Rational Function Approximation
quadl

Adaptive Lobatto Quadrature
repmat

Replicate Matrix
romberg

Romberg Integration
rmserr

Accuracy Measures
simpson2d

Double Simpson Integration
rectint

Rectangle Intersection Areas
spinterp

Monotone (Shape-Preserving) Interpolation
titanium

Titanium Test Data
rk4, rk4sys

Classical Runge-Kutta
abm3pc

Adams-Bashford-Moulton
agmean

Arithmetic-geometric Mean
crossn

n-dimensional Vector Cross Product
distmat

Distance Matrix
fact

Factorial Function
eig

Eigenvalue Function (Matlab Style)
gauss_kronrod

Gauss-Kronrod Quadrature
invlap

Inverse Laplacian
kron

Kronecker product (Matlab Style)
regexp

Match regular expression
newtonInterp

Lagrange and Newtons Interpolation
normest

Estimated Matrix Norm
refindall

Find overlapping regular expression matches.
size

Size of Matrix
std_err

Standard Error
tic,toc

MATLAB timer functions
zeta

Riemann Zeta Function
barylag

Barycentric Lagrange Interpolation
brentDekker

Brent-Dekker Root Finding Algorithm
bsxfun

Elementwise Function Application (Matlab Style)
bvp

Boundary Value Problems
combs

Generate Combinations
chebCoeff

Chebyshev Polynomials
Diag

Matrix Diagonal
euler_heun

Euler-Heun ODE Solver
findmins

Find All Minima
cotes

Newton-Cotes Formulas
clear, who(s), ver

Clear function (Matlab style)
bisect

Rootfinding Through Bisection
deconv

Deconvolution
clenshaw_curtis

Clenshaw-Curtis Quadrature Formula
deeve

Event Detection in ODE solution
dblquad

Double and Triple Integration
dot

Scalar Product
direct1d

Univariate Global Optimization
approx_entropy

Approximate and Sample Entropy
findzeros

Find All Roots
findintervals

Find Interval Indices
ezpolar

Easy Polar Plot
laguerre

Laguerre's Method
fplot

Plot Multivariate Function
fibsearch

Fibonacci Search
fresnelS/C

Fresnel Integrals
horner

Horner's Rule
ndims

Number of Dimensions
arclength

Arc Length of a Curve
bulirsch-stoer

Bulirsch-Stoer Algorithm
errorbar

Plot Error Bars
charpoly

Characteristic Polynomial
complexstep

Complex Step Derivatives
moler

Moler Matrix
Mode

Mode function (Matlab style)
pinv

Pseudoinverse or Generalized Inverse
circlefit

Fitting a Circle
gaussNewton

Gauss-Newton Function Minimization
ezplot

Easy Function Plot
polyadd

Adding Polynomials
ppval

Piecewise Polynomial Structures
fderiv

Numerical Differentiation
neville

Neville's Method
coth,csch,sech, etc.

More Hyperbolic Functions
gammaz

Complex Gamma Function
gradient

Discrete Gradient (Matlab Style)
polytrans

Polynomial Transformation
psi

Psi (Polygamma) Function
regexprep

Replace string using regular expression
ppfit

Piecewise Polynomial Fit
quiver

Quiver or Velocity Plot
gammainc

Incomplete Gamma Function
histc

Histogram Count (Matlab style)
hadamard

Hadamard Matrix
hilb

Hilbert Matrix
rosser

Rosser Matrix
ifft

Inverse Fast Fourier Transformation
randperm

Random Permutation
itersolve

Iterative Methods
Rank

Matrix Rank
strfind

Find Substrings
trigApprox

Trigonometric Approximation
rortho

Generate Random Orthogogonal Matrix
integral

Adaptive Numerical Integration
rkf54

Runge-Kutta-Fehlberg
logspace

Log-linearly Spaced Sequences
ceil

Integer Functions (Matlab Style)
andrewsplot

Andrews' Curves
sortrows

Sort Rows of a Matrix (Matlab Style)
accumarray

Accumulate Vector Elements
lsqnonlin

Nonlinear Least-Squares Fitting
bits

Binary Representation
sorting

Sorting Routines
sumalt

Alternating Series Acceleration
movavg

Moving Average Filters
angle

Basic Complex Functions
cart2sph

Coordinate Transformations
cd, pwd, what

Directory Functions (Matlab style)
blkdiag

Block Diagonal Matrix
trisolve

Tridiagonal Linear System Solver
and, or

Logical AND, OR (Matlab Style)
broyden

Broyden's Method
nnz

Nonzero Elements
nelder_mead

Nelder-Mead Minimization
chebApprox

Chebyshev Approximation
numel

Number of Elements
nthroot

Real nth Root
orth

Range Space
curvefit

Parametric Curve Fit
conv

Polynomial Convolution
ellipke,ellipj

Elliptic and Jacobi Elliptic Integrals
erf

Error Functions and Inverses (Matlab Style)
figure

Control Plot Devices (Matlab Style)
einsteinF

Einstein Functions
poly2str

Print Polynomial
eye

Some Basic Matrices
pade

Pade Approximation
rref

Reduced Row Echelon Form
numderiv

Richardson's Numerical Derivative
barylag2d

2-D Barycentric Lagrange Interpolation
fornberg

Fornberg's Finite Difference Approximation
polymul

Multiplying Polynomials
fminbnd

Finding Function Minimum
segm_distance

Segment Distance
fnorm

Function Norm
pracma-package

Practical Numerical Math Routines
fzero

Root Finding
quad

Adaptive Simpson Quadrature
rat

Continuous Fractions (Matlab Style)
Reshape

Reshape Matrix
gmres

Generalized Minimal Residual Method
hausdorff_dist

Hausdorff Distance
trigPoly

Trigonometric Polynomial
givens

Givens Rotation
halley

Halley's Root Finding Mathod
gaussLaguerre

Gauss-Laguerre Quadrature Formula
gaussLegendre

Gauss-Legendre Quadrature Formula
invperm

Inverse Permutation
vander

Vandermonde matrix
line_integral

Line integral (in the complex plane)
sigmoid

Sigmoid Function
golden_ratio

Golden Ratio Search
mldivide

Matlab backslash operator
newtonHorner

Newton's Root Finding Method for Polynomials.
linspace

Linearly Spaced Sequences
strjust

Justify character vector
isempty

isempty Property
polar

Polar Coordinate Plot (Matlab Style)
linprog

Linear Programming Solver
polyint

Anti-derivative of Polynomial
hypot

Hypotenuse Function
subspace

Angle between two subspaces
lambertWp

Lambert's W Function
perms

Generate Permutations
laplacian

Laplacian Operator
primes

Prime Numbers
legendre

Legendre Functions (Matlab Style)
Norm

Vector Norm
nearest_spd

Nearest Symmetric Positive-definite Matrix
inpolygon

Polygon Region
matlab

Matlab Compatibility
nullspace

Kernel or Nullspace
newtonsys

Newton Method for Nonlinear Systems
pascal

Pascal Triangle
rand

Create Random Matrices
rot90

Matrix Rotation
quadinf

Infinite Integrals
runge

Runge Function
nextpow2

Next Power of 2
ode23

Non-stiff (and stiff) ODE solvers
steep_descent

Steepest Descent Minimization
strcmp

String Comparison
strcat

String Concatenation
peaks

Peaks Function (Matlab Style)
plotyy

Plotting Two y-Axes
polyarea

Area of a Polygon
quadv

Vectorized Integration
semilogx,semilogy

Semi-logarithmic Plots (Matlab Style)
polylog

Polylogarithm Function
simpadpt

Adaptive Simpson Quadrature
squareform

Format Distance Matrix (Matlab Style)
polyval

Evaluating a Polynomial
quadgr

Gaussian Quadrature with Richardson Extrapolation
sqrtm,rootm

Matrix Square and p-th Roots
std

Standard Deviation (Matlab Style)
str2num

Converting string to number (Matlab style)
ridders

Ridders' Method
strRep

Find and replace substring
quadgk

Adaptive Gauss-Kronrod Quadrature
ratinterp

Rational Interpolation
softline

Soft (Inexact) Line Search
savgol

Savitzky-Golay Smoothing
aitken

Aitken' Method
expm

Matrix Exponential
tri

Triangular Matrices (Matlab Style)
eta

Dirichlet Eta Function
cross

Vector Cross Product
flipdim

Matrix Flipping (Matlab Style)
vectorfield

Vector Field Plotting
findpeaks

Find Peaks
ezcontour,ezmesh

Contour and Mesh Plotter
expint

Exponential and Logarithmic Integral
gramSchmidt

Gram-Schmidt
hampel

Hampel Filter
householder

Householder Reflections
inv

Matrix Inverse (Matlab Style)
humps

Matlab Test Functions
integral2

Numerically Evaluate Double and Triple Integrals
L1linreg

L1 Linear Regression
kriging

Interpolation by Kriging
mexpfit

Multi-exponential Fitting
newmark

Newmark Method
nile

Nile overflow data
odregress

Orthogonal Distance Regression
polyfit

Fitting by Polynomial
qrSolve

LSE Solution
pchip

Hermitean Interpolation Polynomials
pow2

Base 2 Power
triquad

Gaussian Triangle Quadrature
bernoulli

Bernoulli Numbers and Polynomials
chebPoly

Chebyshev Polynomials
eigjacobi

Jacobi Eigenvalue Method
factors

Prime Factors
finds

find function (Matlab Style)
eps

Floating Point Relative Accuracy
fsolve

Solve System of Nonlinear Equations
hessian

Hessian Matrix
hankel

Hankel Matrix
lebesgue

Lebesgue Constant
muller

Muller's Method
qpspecial

Special Quadratic Programming Solver
roots

Polynomial Roots
segm_intersect

Segment Intersection
Toeplitz

Toeplitz Matrix
Trace

Matrix trace
trapz

Trapezoidal Integration
strTrim

Remove leading and trailing white space.
akimaInterp

Univariate Akima Interpolation
cond

Matrix Condition
deval

Evaluate ODE Solution
cubicspline

Interpolating Cubic Spline
gcd, lcm

GCD and LCM Integer Functions
interp1

One-dimensional Interpolation
histss

Histogram Bin-width Optimization
meshgrid

Generate a Mesh Grid
geomean, harmmean

Geometric and Harmonic Mean (Matlab Style)
lsqlin

Linear Least-Squares Fitting
mod, rem

Integer Division
newtonRaphson

Rootfinding through Newton-Raphson or Secant.
polyApprox

Polynomial Approximation
procrustes

Solving the Procrustes Problem
randcomb

Random Combination
taylor

Taylor Series Approximation
cot,csc,sec, etc.

More Trigonometric Functions
whittaker

Whittaker Smoothing
wilkinson

wilkinson Matrix