Learn R Programming

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

pracma (version 1.7.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.7.3

License

GPL (>= 3)

Maintainer

Last Published

October 12th, 2014

Functions in pracma (1.7.3)

brent_dekker

Brent-Dekker Root Finding Algorithm
ceil

Integer Functions (Matlab Style)
accumarray

Accumulate Vector Elements
cd, pwd, what

Directory Functions (Matlab style)
deeve

Event Detection in ODE solution
clear, who(s), ver

Clear function (Matlab style)
agmean

Arithmetic-geometric Mean
angle

Basic Complex Functions
akimaInterp

Univariate Akima Interpolation
factors

Prime Factors
bisect

Rootfinding Through Bisection
clenshaw_curtis

Clenshaw-Curtis Quadrature Formula
expm

Matrix Exponential
cutpoints

Find Cutting Points
combs

Generate Combinations
barylag

Barycentric Lagrange Interpolation
bvp

Boundary Value Problems
abm3pc

Adams-Bashford-Moulton
findpeaks

Find Peaks
einsteinF

Einstein Functions
errorbar

Plot Error Bars
ezcontour,ezmesh

Contour and Mesh Plotter
gaussNewton

Gauss-Newton Function Minimization
direct1d

Univariate Global Optimization
bits

Binary Representation
cart2sph

Coordinate Transformations
ellipke,ellipj

Elliptic and Jacobi Elliptic Integrals
ezplot

Easy Function Plot
chebCoeff

Chebyshev Polynomials
dot

Scalar Product
crossn

n-dimensional Vector Cross Product
complexstep

Complex Step Derivatives
fornberg

Fornberg's Finite Difference Approximation
findintervals

Find Interval Indices
gaussHermite

Gauss-Hermite Quadrature Formula
andrewsplot

Andrews' Curves
arclength

Arc Length of a Curve
broyden

Broyden's Method
brown72

Brownian Motion
charpoly

Characteristic Polynomial
deval

Evaluate ODE Solution
Diag

Matrix Diagonal
gmres

Generalized Minimal Residual Method
hooke_jeeves

Hooke-Jeeves Method
eye

Some Basic Matrices
gammainc

Incomplete Gamma Function
finds

find function (Matlab Style)
fderiv

Numerical Differentiation
givens

Givens Rotation
hankel

Hankel Matrix
horner

Horner's Rule
fsolve

Solve System of Nonlinear Equations
coth,csch,sech, etc.

More Hyperbolic Functions
inv

Matrix Inverse (Matlab Style)
itersolve

Iterative Methods
lambertWp

Lambert's W Function
figure

Control Plot Devices (Matlab Style)
gcd, lcm

GCD and LCM Integer Functions
fplot

Plot Multivariate Function
gauss_kronrod

Gauss-Kronrod Quadrature
isempty

isempty Property
inpolygon

Polygon Region
ifft

Inverse Fast Fourier Transformation
mexpfit

Multi-exponential Fitting
meshgrid

Generate a Mesh Grid
laplacian

Laplacian Operator
lu

LU Matrix Factorization
L1linreg

L1 Linear Regression
pade

Pade Approximation
neville

Neville's Method
magic

Magic Square
quadgk

Adaptive Gauss-Kronrod Quadrature
odregress

Orthogonal Distance Regression
nthroot

Real nth Root
newtonsys

Newton Method for Nonlinear Systems
quiver

Quiver or Velocity Plot
newtonRaphson

Rootfinding through Newton-Raphson or Secant.
halley

Halley's Root Finding Mathod
nullspace

Kernel or Nullspace
newtonHorner

Newton's Root Finding Method for Polynomials.
polytrans

Polynomial Transformation
hadamard

Hadamard Matrix
interp2

Two-dimensional Data Interpolation
interp1

One-dimensional Interpolation
refindall

Find overlapping regular expression matches.
pchip

Hermitean Interpolation Polynomials
mod, rem

Integer Division
nearest_spd

Nearest Symmetric Positive-definite Matrix
Norm

Vector Norm
kriging

Interpolation by Kriging
kron

Kronecker product (Matlab Style)
line_integral

Line integral (in the complex plane)
jacobian

Jacobian Matrix
rationalfit

Rational Function Approximation
piecewise

Piecewise Linear Function
polar

Polar Coordinate Plot (Matlab Style)
Reshape

Reshape Matrix
moler

Moler Matrix
rmserr

Accuracy Measures
blkdiag

Block Diagonal Matrix
perms

Generate Permutations
pinv

Pseudoinverse or Generalized Inverse
primes

Prime Numbers
quadv

Vectorized Integration
ratinterp

Rational Interpolation
numel

Number of Elements
rk4, rk4sys

Classical Runge-Kutta
plotyy

Plotting Two y-Axes
numderiv

Richardson's Numerical Derivative
cranknic

Crank-Nicolson Method
conv

Polynomial Convolution
cross

Vector Cross Product
pascal

Pascal Triangle
ridders

Ridders' Method
barylag2d

2-D Barycentric Lagrange Interpolation
polyApprox

Polynomial Approximation
blanks

String of Blank Carakters
cubicspline

Interpolating Cubic Spline
cotes

Newton-Cotes Formulas
eig

Eigenvalue Function (Matlab Style)
regexprep

Replace string using regular expression
polyadd

Adding Polynomials
normest

Estimated Matrix Norm
Trace

Matrix trace
polyfit

Fitting by Polynomial
triquad

Gaussian Triangle Quadrature
polyarea

Area of a Polygon
polyder

Derivative of Polynomial
rat

Continuous Fractions (Matlab Style)
polypow

Polynomial Powers
rortho

Generate Random Orthogogonal Matrix
quadinf

Infinite Integrals
Rank

Matrix Rank
softline

Soft (Inexact) Line Search
subspace

Angle between two subspaces
rosser

Rosser Matrix
trisolve

Tridiagonal Linear System Solver
savgol

Savitzky-Golay Smoothing
erf

Error Functions and Inverses (Matlab Style)
euler_heun

Euler-Heun ODE Solver
Toeplitz

Toeplitz Matrix
std

Standard Deviation (Matlab Style)
segm_intersect

Segment Intersection
eps

Floating Point Relative Accuracy
fibsearch

Fibonacci Search
sortrows

Sort Rows of a Matrix (Matlab Style)
regexp

Match regular expression
distmat

Distance Matrix
ezpolar

Easy Polar Plot
fletcher-powell

Davidon-Fletcher-Powell Method
fnorm

Function Norm
hilb

Hilbert Matrix
segm_distance

Segment Distance
humps

Matlab Test Functions
tic,toc

MATLAB timer functions
quadcc

Adaptive Clenshaw-Curtis Quadrature
trigApprox

Trigonometric Approximation
vectorfield

Vector Field Plotting
titanium

Titanium Test Data
whittaker

Whittaker Smoothing
gaussLaguerre

Gauss-Laguerre Quadrature Formula
golden_ratio

Golden Ratio Search
gradient

Discrete Gradient (Matlab Style)
fzsolve

Complex Root Finding
invperm

Inverse Permutation
linspace

Linearly Spaced Sequences
nelder_mead

Nelder-Mead Minimization Method
householder

Householder Reflections
newmark

Newmark Method
nextpow2

Next Power of 2
lsqnonlin

Nonlinear Least-Squares Fitting
peaks

Peaks Function (Matlab Style)
geomean, harmmean

Geometric and Harmonic Mean (Matlab Style)
muller

Muller's Method
mldivide

Matlab backslash operator
nnz

Nonzero Elements
quadgr

Gaussian Quadrature with Richardson Extrapolation
rand

Create Random Matrices
ppval

Piecewise Polynomial Structures
rectint

Rectangle Intersection Areas
runge

Runge Function
simpadpt

Adaptive Simpson Quadrature
strjust

Justify character vector
cot,csc,sec, etc.

More Trigonometric Functions
std_err

Standard Error
rot90

Matrix Rotation
polymul

Multiplying Polynomials
pow2

Base 2 Power
pracma-package

Practical Numerical Math Routines
ppfit

Piecewise Polynomial Fit
repmat

Replicate Matrix
str2num

Converting string to number (Matlab style)
sigmoid

Sigmoid Function
rref

Reduced Row Echelon Form
squareform

Format Distance Matrix (Matlab Style)
wilkinson

wilkinson Matrix
curvefit

Parametric Curve Fit
detrend

Remove Linear Trends
expint

Exponential and Logarithmic Integral
findmins

Find All Minima
findzeros

Find All Roots
fzero

Root Finding
flipdim

Matrix Flipping (Matlab Style)
hampel

Hampel Filter
hessian

Hessian Matrix
integral2

Numerically Evaluate Double and Triple Integrals
linprog

Linear Programming Solver
laguerre

Laguerre's Method
legendre

Legendre Functions (Matlab Style)
logspace

Log-linearly Spaced Sequences
newtonInterp

Lagrange and Newtons Interpolation
movavg

Moving Average Filters
ode23

Non-stiff ODE solvers
Poly

Define Polynomial by Roots
polyint

Anti-derivative of Polynomial
polyval

Evaluating a Polynomial
polylog

Polylogarithm Function
qrSolve

LSE Solution
randperm

Random Permutation
randcomb

Random Combination
rkf54

Runge-Kutta-Fehlberg
sorting

Sorting Routines
strcat

String Concatenation
tri

Triangular Matrices (Matlab Style)
trigPoly

Trigonometric Polynomial
zeta

Riemann Zeta Function
vander

Vandermonde matrix
trapz

Trapezoidal Integration
bsxfun

Elementwise Function Application (Matlab Style)
chebApprox

Chebyshev Approximation
cond

Matrix Condition
compan

Companion Matrix
deconv

Deconvolution
fminsearch

Minimum Finding
eigjacobi

Jacobi Eigenvalue Method
gaussLegendre

Gauss-Legendre Quadrature Formula
gammaz

Complex Gamma Function
grad

Numerical Gradient
geo_median

Geometric Median
lebesgue

Lebesgue Constant
integral

Adaptive Numerical Integration
gramSchmidt

Gram-Schmidt
lsqlin

Linear Least-Squares Fitting
orth

Range Space
quad2d

2-d Gaussian Quadrature
runs.test

The Runs Test, or Wald-Wolfowitz Test
strfind

Find Substrings
romberg

Romberg Integration
aitken

Aitken' Method
and, or

Logical AND, OR (Matlab Style)
disp,beep

Utility functions (Matlab style)
circlefit

Fitting a Circle
chebPoly

Chebyshev Polynomials
deg2rad

Degrees to Radians
approx_entropy

Approximate and Sample Entropy
dblquad

Double and Triple Integration
eta

Dirichlet Eta Function
fact

Factorial Function
fresnelS/C

Fresnel Integrals
fminbnd

Finding Function Minimum
histc

Histogram Count (Matlab style)
histss

Histogram Bin-width Optimization
hausdorff_dist

Hausdorff Distance
hypot

Hypotenuse Function
hurstexp

Hurst Exponent
invlap

Inverse Laplacian
isprime

isprime Property
matlab

Matlab Compatibility
Mode

Mode function (Matlab style)
nchoosek

Binomial Coefficients
ndims

Number of Dimensions
nile

Nile overflow data
procrustes

Solving the Procrustes Problem
poly2str

Print Polynomial
psi

Psi (Polygamma) Function
quad

Adaptive Simpson Quadrature
quadl

Adaptive Lobatto Quadrature
semilogx,semilogy

Semi-logarithmic Plots (Matlab Style)
simpson2d

Double Simpson Integration
size

Size of Matrix
spinterp

Monotone (Shape-Preserving) Interpolation
strrep

Find and replace substring
sqrtm,rootm

Matrix Square and p-th Roots
strTrim

Remove leading and trailing white space.
strcmp

String Comparison
roots

Polynomial Roots
steepest_descent

Steepest Descent
taylor

Taylor Series Approximation