Learn R Programming

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

pracma (version 1.9.3)

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

License

GPL (>= 3)

Maintainer

Last Published

May 29th, 2016

Functions in pracma (1.9.3)

barylag2d

2-D Barycentric Lagrange Interpolation
abm3pc

Adams-Bashford-Moulton
angle

Basic Complex Functions
accumarray

Accumulate Vector Elements
akimaInterp

Univariate Akima Interpolation
arclength

Arc Length of a Curve
aitken

Aitken' Method
andrewsplot

Andrews' Curves
barylag

Barycentric Lagrange Interpolation
and, or

Logical AND, OR (Matlab Style)
blanks

String of Blank Carakters
brentDekker

Brent-Dekker Root Finding Algorithm
blkdiag

Block Diagonal Matrix
bisect

Rootfinding Through Bisection
broyden

Broyden's Method
bsxfun

Elementwise Function Application (Matlab Style)
cart2sph

Coordinate Transformations
brown72

Brownian Motion
bits

Binary Representation
disp,beep

Utility functions (Matlab style)
clear, who(s), ver

Clear function (Matlab style)
charpoly

Characteristic Polynomial
ceil

Integer Functions (Matlab Style)
circlefit

Fitting a Circle
cd, pwd, what

Directory Functions (Matlab style)
clenshaw_curtis

Clenshaw-Curtis Quadrature Formula
combs

Generate Combinations
chebCoeff

Chebyshev Polynomials
chebPoly

Chebyshev Polynomials
chebApprox

Chebyshev Approximation
cranknic

Crank-Nicolson Method
crossn

n-dimensional Vector Cross Product
cotes

Newton-Cotes Formulas
compan

Companion Matrix
complexstep

Complex Step Derivatives
curvefit

Parametric Curve Fit
cross

Vector Cross Product
cubicspline

Interpolating Cubic Spline
cond

Matrix Condition
conv

Polynomial Convolution
deval

Evaluate ODE Solution
deconv

Deconvolution
dblquad

Double and Triple Integration
direct1d

Univariate Global Optimization
deg2rad

Degrees to Radians
detrend

Remove Linear Trends
Diag

Matrix Diagonal
cutpoints

Find Cutting Points
distmat

Distance Matrix
deeve

Event Detection in ODE solution
errorbar

Plot Error Bars
finds

find function (Matlab Style)
eta

Dirichlet Eta Function
ezcontour,ezmesh

Contour and Mesh Plotter
ezplot

Easy Function Plot
findintervals

Find Interval Indices
fnorm

Function Norm
fornberg

Fornberg's Finite Difference Approximation
givens

Givens Rotation
gmres

Generalized Minimal Residual Method
fplot

Plot Multivariate Function
gammaz

Complex Gamma Function
fractalcurve

Fractal Curves
hessian

Hessian Matrix
fzsolve

Complex Root Finding
hilb

Hilbert Matrix
householder

Householder Reflections
humps

Matlab Test Functions
eps

Floating Point Relative Accuracy
erf

Error Functions and Inverses (Matlab Style)
fminsearch

Minimum Finding
fminbnd

Finding Function Minimum
hankel

Hankel Matrix
gauss_kronrod

Gauss-Kronrod Quadrature
hausdorff_dist

Hausdorff Distance
gaussLegendre

Gauss-Legendre Quadrature Formula
horner

Horner's Rule
hooke_jeeves

Hooke-Jeeves Minimization Method
kriging

Interpolation by Kriging
jacobian

Jacobian Matrix
meshgrid

Generate a Mesh Grid
bulirsch-stoer

Bulirsch-Stoer Algorithm
mod, rem

Integer Division
newtonRaphson

Rootfinding through Newton-Raphson or Secant.
mldivide

Matlab backslash operator
newtonsys

Newton Method for Nonlinear Systems
numel

Number of Elements
itersolve

Iterative Methods
isprime

isprime Property
legendre

Legendre Functions (Matlab Style)
line_integral

Line integral (in the complex plane)
matlab

Matlab Compatibility
nchoosek

Binomial Coefficients
geomean, harmmean

Geometric and Harmonic Mean (Matlab Style)
eye

Some Basic Matrices
factors

Prime Factors
euler_heun

Euler-Heun ODE Solver
fderiv

Numerical Differentiation
halley

Halley's Root Finding Mathod
hampel

Hampel Filter
ode23

Non-stiff (and stiff) ODE solvers
pchip

Hermitean Interpolation Polynomials
polyval

Evaluating a Polynomial
peaks

Peaks Function (Matlab Style)
pow2

Base 2 Power
procrustes

Solving the Procrustes Problem
qpspecial

Special Quadratic Programming Solver
interp2

Two-dimensional Data Interpolation
inv

Matrix Inverse (Matlab Style)
kron

Kronecker product (Matlab Style)
L1linreg

L1 Linear Regression
pade

Pade Approximation
lu

LU Matrix Factorization
pascal

Pascal Triangle
magic

Magic Square
neville

Neville's Method
ndims

Number of Dimensions
newmark

Newmark Method
numderiv

Richardson's Numerical Derivative
nullspace

Kernel or Nullspace
perms

Generate Permutations
polyfit,polyfix

Fitting by Polynomial
piecewise

Piecewise Linear Function
ppval

Piecewise Polynomial Structures
polyder

Derivative of Polynomial
eigjacobi

Jacobi Eigenvalue Method
ezpolar

Easy Polar Plot
approx_entropy

Approximate and Sample Entropy
fact

Factorial Function
findmins

Find All Minima
findpeaks

Find Peaks
fibsearch

Fibonacci Search
dot

Scalar Product
figure

Control Plot Devices (Matlab Style)
eig

Eigenvalue Function (Matlab Style)
findzeros

Find All Roots
flipdim

Matrix Flipping (Matlab Style)
hypot

Hypotenuse Function
ifft

Inverse Fast Fourier Transformation
inpolygon

Polygon Region
integral

Adaptive Numerical Integration
lsqlin

Linear Least-Squares Fitting
lambertWp

Lambert's W Function
laguerre

Laguerre's Method
lsqlincon

Linear Least-Squares Fitting with linear constraints
randperm

Random Permutation
Rank

Matrix Rank
rationalfit

Rational Function Approximation
rectint

Rectangle Intersection Areas
runge

Runge Function
savgol

Savitzky-Golay Smoothing
str2num

Converting string to number (Matlab style)
simpson2d

Double Simpson Integration
strcat

String Concatenation
size

Size of Matrix
ppfit

Piecewise Polynomial Fit
quadgk

Adaptive Gauss-Kronrod Quadrature
quadgr

Gaussian Quadrature with Richardson Extrapolation
rot90

Matrix Rotation
rref

Reduced Row Echelon Form
squareform

Format Distance Matrix (Matlab Style)
segm_distance

Segment Distance
std_err

Standard Error
segm_intersect

Segment Intersection
movavg

Moving Average Filters
muller

Muller's Method
Toeplitz

Toeplitz Matrix
nnz

Nonzero Elements
Norm

Vector Norm
normest

Estimated Matrix Norm
nthroot

Real nth Root
pracma-package

Practical Numerical Math Routines
pinv

Pseudoinverse or Generalized Inverse
primes

Prime Numbers
plotyy

Plotting Two y-Axes
fsolve

Solve System of Nonlinear Equations
fzero

Root Finding
golden_ratio

Golden Ratio Search
gradient

Discrete Gradient (Matlab Style)
histc

Histogram Count (Matlab style)
interp1

One-dimensional Interpolation
histss

Histogram Bin-width Optimization
logspace

Log-linearly Spaced Sequences
integral2

Numerically Evaluate Double and Triple Integrals
quadv

Vectorized Integration
linspace

Linearly Spaced Sequences
quiver

Quiver or Velocity Plot
refindall

Find overlapping regular expression matches.
regexp

Match regular expression
std

Standard Deviation (Matlab Style)
trisolve

Tridiagonal Linear System Solver
steep_descent

Steepest Descent Minimization
trapz

Trapezoidal Integration
triquad

Gaussian Triangle Quadrature
whittaker

Whittaker Smoothing
tri

Triangular Matrices (Matlab Style)
polar

Polar Coordinate Plot (Matlab Style)
wilkinson

wilkinson Matrix
Poly

Define Polynomial by Roots
polyint

Anti-derivative of Polynomial
polymul

Multiplying Polynomials
regexprep

Replace string using regular expression
quad2d

2-d Gaussian Quadrature
quadcc

Adaptive Clenshaw-Curtis Quadrature
repmat

Replicate Matrix
romberg

Romberg Integration
roots

Polynomial Roots
Mode

Mode function (Matlab style)
moler

Moler Matrix
newtonHorner

Newton's Root Finding Method for Polynomials.
newtonInterp

Lagrange and Newtons Interpolation
polypow

Polynomial Powers
odregress

Orthogonal Distance Regression
polytrans

Polynomial Transformation
orth

Range Space
quad

Adaptive Simpson Quadrature
qrSolve

LSE Solution
Trace

Matrix trace
gcd, lcm

GCD and LCM Integer Functions
geo_median

Geometric Median
gramSchmidt

Gram-Schmidt
hurstexp

Hurst Exponent
hadamard

Hadamard Matrix
invlap

Inverse Laplacian
isempty

isempty Property
coth,csch,sech, etc.

More Hyperbolic Functions
laplacian

Laplacian Operator
lebesgue

Lebesgue Constant
sortrows

Sort Rows of a Matrix (Matlab Style)
spinterp

Monotone (Shape-Preserving) Interpolation
strfind

Find Substrings
strcmp

String Comparison
subspace

Angle between two subspaces
strTrim

Remove leading and trailing white space.
cot,csc,sec, etc.

More Trigonometric Functions
rand

Create Random Matrices
trigApprox

Trigonometric Approximation
randcomb

Random Combination
Reshape

Reshape Matrix
rk4, rk4sys

Classical Runge-Kutta
rkf54

Runge-Kutta-Fehlberg
simpadpt

Adaptive Simpson Quadrature
rmserr

Accuracy Measures
sumalt

Alternating Series Acceleration
semilogx,semilogy

Semi-logarithmic Plots (Matlab Style)
taylor

Taylor Series Approximation
vander

Vandermonde matrix
vectorfield

Vector Field Plotting
nearest_spd

Nearest Symmetric Positive-definite Matrix
nelder_mead

Nelder-Mead Minimization
nextpow2

Next Power of 2
poly2str

Print Polynomial
nile

Nile overflow data
polyarea

Area of a Polygon
polyApprox

Polynomial Approximation
polyadd

Adding Polynomials
quadl

Adaptive Lobatto Quadrature
quadinf

Infinite Integrals
rat

Continuous Fractions (Matlab Style)
ratinterp

Rational Interpolation
rortho

Generate Random Orthogogonal Matrix
rosser

Rosser Matrix
sorting

Sorting Routines
softline

Soft (Inexact) Line Search
strRep

Find and replace substring
strjust

Justify character vector
tic,toc

MATLAB timer functions
titanium

Titanium Test Data
zeta

Riemann Zeta Function