Learn R Programming

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

pracma (version 1.7.9)

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

License

GPL (>= 3)

Maintainer

Last Published

November 15th, 2014

Functions in pracma (1.7.9)

abm3pc

Adams-Bashford-Moulton
clenshaw_curtis

Clenshaw-Curtis Quadrature Formula
conv

Polynomial Convolution
compan

Companion Matrix
cond

Matrix Condition
deeve

Event Detection in ODE solution
detrend

Remove Linear Trends
eye

Some Basic Matrices
expm

Matrix Exponential
euler_heun

Euler-Heun ODE Solver
gaussHermite

Gauss-Hermite Quadrature Formula
geo_median

Geometric Median
fresnelS/C

Fresnel Integrals
hilb

Hilbert Matrix
hankel

Hankel Matrix
humps

Matlab Test Functions
L1linreg

L1 Linear Regression
legendre

Legendre Functions (Matlab Style)
geomean, harmmean

Geometric and Harmonic Mean (Matlab Style)
pchip

Hermitean Interpolation Polynomials
polyarea

Area of a Polygon
polyint

Anti-derivative of Polynomial
quadl

Adaptive Lobatto Quadrature
std_err

Standard Error
tic,toc

MATLAB timer functions
vander

Vandermonde matrix
wilkinson

wilkinson Matrix
procrustes

Solving the Procrustes Problem
quadgr

Gaussian Quadrature with Richardson Extrapolation
deval

Evaluate ODE Solution
erf

Error Functions and Inverses (Matlab Style)
Poly

Define Polynomial by Roots
ratinterp

Rational Interpolation
akimaInterp

Univariate Akima Interpolation
clear, who(s), ver

Clear function (Matlab style)
disp,beep

Utility functions (Matlab style)
accumarray

Accumulate Vector Elements
bits

Binary Representation
fibsearch

Fibonacci Search
ceil

Integer Functions (Matlab Style)
direct1d

Univariate Global Optimization
fact

Factorial Function
broyden

Broyden's Method
Diag

Matrix Diagonal
chebApprox

Chebyshev Approximation
ezcontour,ezmesh

Contour and Mesh Plotter
fzsolve

Complex Root Finding
cd, pwd, what

Directory Functions (Matlab style)
approx_entropy

Approximate and Sample Entropy
findintervals

Find Interval Indices
hampel

Hampel Filter
grad

Numerical Gradient
angle

Basic Complex Functions
hessian

Hessian Matrix
blanks

String of Blank Carakters
gaussLegendre

Gauss-Legendre Quadrature Formula
fornberg

Fornberg's Finite Difference Approximation
ezpolar

Easy Polar Plot
eta

Dirichlet Eta Function
fnorm

Function Norm
bsxfun

Elementwise Function Application (Matlab Style)
deconv

Deconvolution
fderiv

Numerical Differentiation
chebCoeff

Chebyshev Polynomials
crossn

n-dimensional Vector Cross Product
fsolve

Solve System of Nonlinear Equations
householder

Householder Reflections
coth,csch,sech, etc.

More Hyperbolic Functions
eigjacobi

Jacobi Eigenvalue Method
dot

Scalar Product
bisect

Rootfinding Through Bisection
charpoly

Characteristic Polynomial
barylag2d

2-D Barycentric Lagrange Interpolation
findzeros

Find All Roots
gcd, lcm

GCD and LCM Integer Functions
barylag

Barycentric Lagrange Interpolation
cotes

Newton-Cotes Formulas
distmat

Distance Matrix
halley

Halley's Root Finding Mathod
interp2

Two-dimensional Data Interpolation
lambertWp

Lambert's W Function
agmean

Arithmetic-geometric Mean
expint

Exponential and Logarithmic Integral
deg2rad

Degrees to Radians
isempty

isempty Property
flipdim

Matrix Flipping (Matlab Style)
laplacian

Laplacian Operator
golden_ratio

Golden Ratio Search
brown72

Brownian Motion
gammaz

Complex Gamma Function
integral2

Numerically Evaluate Double and Triple Integrals
integral

Adaptive Numerical Integration
findmins

Find All Minima
gammainc

Incomplete Gamma Function
matlab

Matlab Compatibility
kron

Kronecker product (Matlab Style)
nextpow2

Next Power of 2
gauss_kronrod

Gauss-Kronrod Quadrature
numderiv

Richardson's Numerical Derivative
movavg

Moving Average Filters
pinv

Pseudoinverse or Generalized Inverse
polyadd

Adding Polynomials
finds

find function (Matlab Style)
findpeaks

Find Peaks
cross

Vector Cross Product
hadamard

Hadamard Matrix
nnz

Nonzero Elements
curvefit

Parametric Curve Fit
dblquad

Double and Triple Integration
cart2sph

Coordinate Transformations
perms

Generate Permutations
newtonRaphson

Rootfinding through Newton-Raphson or Secant.
polar

Polar Coordinate Plot (Matlab Style)
piecewise

Piecewise Linear Function
brentDekker

Brent-Dekker Root Finding Algorithm
arclength

Arc Length of a Curve
chebPoly

Chebyshev Polynomials
peaks

Peaks Function (Matlab Style)
gmres

Generalized Minimal Residual Method
cutpoints

Find Cutting Points
plotyy

Plotting Two y-Axes
invlap

Inverse Laplacian
polypow

Polynomial Powers
horner

Horner's Rule
gradient

Discrete Gradient (Matlab Style)
hooke_jeeves

Hooke-Jeeves Minimization Method
polyder

Derivative of Polynomial
rationalfit

Rational Function Approximation
figure

Control Plot Devices (Matlab Style)
gramSchmidt

Gram-Schmidt
quad2d

2-d Gaussian Quadrature
eps

Floating Point Relative Accuracy
histss

Histogram Bin-width Optimization
qpspecial

Special Quadratic Programming Solver
randperm

Random Permutation
newmark

Newmark Method
Reshape

Reshape Matrix
fletcher-powell

Davidon-Fletcher-Powell Method
givens

Givens Rotation
regexp

Match regular expression
ifft

Inverse Fast Fourier Transformation
interp1

One-dimensional Interpolation
nelder_mead

Nelder-Mead Minimization
inv

Matrix Inverse (Matlab Style)
rmserr

Accuracy Measures
kriging

Interpolation by Kriging
segm_intersect

Segment Intersection
str2num

Converting string to number (Matlab style)
rref

Reduced Row Echelon Form
line_integral

Line integral (in the complex plane)
lu

LU Matrix Factorization
fminbnd

Finding Function Minimum
linprog

Linear Programming Solver
jacobian

Jacobian Matrix
fplot

Plot Multivariate Function
spinterp

Monotone (Shape-Preserving) Interpolation
invperm

Inverse Permutation
sortrows

Sort Rows of a Matrix (Matlab Style)
segm_distance

Segment Distance
strjust

Justify character vector
trigApprox

Trigonometric Approximation
magic

Magic Square
polylog

Polylogarithm Function
savgol

Savitzky-Golay Smoothing
simpadpt

Adaptive Simpson Quadrature
nchoosek

Binomial Coefficients
mod, rem

Integer Division
quadgk

Adaptive Gauss-Kronrod Quadrature
size

Size of Matrix
steep_descent

Steepest Descent Minimization
nearest_spd

Nearest Symmetric Positive-definite Matrix
isprime

isprime Property
itersolve

Iterative Methods
strTrim

Remove leading and trailing white space.
laguerre

Laguerre's Method
newtonsys

Newton Method for Nonlinear Systems
polyfit

Fitting by Polynomial
meshgrid

Generate a Mesh Grid
lebesgue

Lebesgue Constant
newtonInterp

Lagrange and Newtons Interpolation
poly2str

Print Polynomial
std

Standard Deviation (Matlab Style)
quadcc

Adaptive Clenshaw-Curtis Quadrature
Rank

Matrix Rank
pade

Pade Approximation
bulirsch-stoer

Bulirsch-Stoer Algorithm
quad

Adaptive Simpson Quadrature
newtonHorner

Newton's Root Finding Method for Polynomials.
ppfit

Piecewise Polynomial Fit
rortho

Generate Random Orthogogonal Matrix
moler

Moler Matrix
lsqlin

Linear Least-Squares Fitting
simpson2d

Double Simpson Integration
polyval

Evaluating a Polynomial
qrSolve

LSE Solution
primes

Prime Numbers
numel

Number of Elements
refindall

Find overlapping regular expression matches.
rat

Continuous Fractions (Matlab Style)
quadv

Vectorized Integration
randcomb

Random Combination
rectint

Rectangle Intersection Areas
runs.test

The Runs Test, or Wald-Wolfowitz Test
rot90

Matrix Rotation
strcat

String Concatenation
regexprep

Replace string using regular expression
romberg

Romberg Integration
roots

Polynomial Roots
semilogx,semilogy

Semi-logarithmic Plots (Matlab Style)
sorting

Sorting Routines
muller

Muller's Method
nullspace

Kernel or Nullspace
mldivide

Matlab backslash operator
taylor

Taylor Series Approximation
polyApprox

Polynomial Approximation
softline

Soft (Inexact) Line Search
strcmp

String Comparison
nile

Nile overflow data
tri

Triangular Matrices (Matlab Style)
strrep

Find and replace substring
odregress

Orthogonal Distance Regression
sqrtm,rootm

Matrix Square and p-th Roots
repmat

Replicate Matrix
titanium

Titanium Test Data
whittaker

Whittaker Smoothing
cot,csc,sec, etc.

More Trigonometric Functions
trigPoly

Trigonometric Polynomial
trisolve

Tridiagonal Linear System Solver
triquad

Gaussian Triangle Quadrature
Trace

Matrix trace
trapz

Trapezoidal Integration
zeta

Riemann Zeta Function
blkdiag

Block Diagonal Matrix
aitken

Aitken' Method
bvp

Boundary Value Problems
circlefit

Fitting a Circle
cranknic

Crank-Nicolson Method
cubicspline

Interpolating Cubic Spline
ellipke,ellipj

Elliptic and Jacobi Elliptic Integrals
errorbar

Plot Error Bars
factors

Prime Factors
ezplot

Easy Function Plot
fminsearch

Minimum Finding
fzero

Root Finding
gaussNewton

Gauss-Newton Function Minimization
gaussLaguerre

Gauss-Laguerre Quadrature Formula
histc

Histogram Count (Matlab style)
hurstexp

Hurst Exponent
inpolygon

Polygon Region
logspace

Log-linearly Spaced Sequences
mexpfit

Multi-exponential Fitting
Mode

Mode function (Matlab style)
ndims

Number of Dimensions
neville

Neville's Method
Norm

Vector Norm
nthroot

Real nth Root
ode23

Non-stiff (and stiff) ODE solvers
normest

Estimated Matrix Norm
orth

Range Space
pascal

Pascal Triangle
pow2

Base 2 Power
pracma-package

Practical Numerical Math Routines
quiver

Quiver or Velocity Plot
quadinf

Infinite Integrals
ridders

Ridders' Method
rand

Create Random Matrices
rk4, rk4sys

Classical Runge-Kutta
rkf54

Runge-Kutta-Fehlberg
subspace

Angle between two subspaces
Toeplitz

Toeplitz Matrix
andrewsplot

Andrews' Curves
and, or

Logical AND, OR (Matlab Style)
complexstep

Complex Step Derivatives
combs

Generate Combinations
einsteinF

Einstein Functions
eig

Eigenvalue Function (Matlab Style)
hausdorff_dist

Hausdorff Distance
hypot

Hypotenuse Function
linspace

Linearly Spaced Sequences
lsqnonlin

Nonlinear Least-Squares Fitting
polytrans

Polynomial Transformation
ppval

Piecewise Polynomial Structures
psi

Psi (Polygamma) Function
polymul

Multiplying Polynomials
runge

Runge Function
rosser

Rosser Matrix
sigmoid

Sigmoid Function
squareform

Format Distance Matrix (Matlab Style)
strfind

Find Substrings
vectorfield

Vector Field Plotting