Learn R Programming

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

pracma (version 1.5.8)

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

License

GPL (>= 3)

Maintainer

Last Published

November 28th, 2013

Functions in pracma (1.5.8)

blkdiag

Block Diagonal Matrix
charpoly

Characteristic Polynomial
cross

Vector Cross Product
combs

Generate Combinations
expm

Matrix Exponential
ezcontour,ezmesh

Contour and Mesh Plotter
einsteinF

Einstein Functions
grad

Numerical Gradient
gammainc

Incomplete Gamma Function
hankel

Hankel Matrix
histss

Histogram Bin-width Optimization
isprime

isprime Property
invlap

Inverse Laplacian
matlab

Matlab Compatibility
Mode

Mode function (Matlab style)
dblquad

Double and Triple Integration
cart2sph

Coordinate Transformations
akimaInterp

Univariate Akima Interpolation
eps

Floating Point Relative Accuracy
nthroot

Real nth Root
ezpolar

Easy Polar Plot
nelder_mead

Nelder-Mead Minimization Method
gammaz

Complex Gamma Function
errorbar

Plot Error Bars
expint

Exponential and Logarithmic Integral
gaussNewton

Gauss-Newton Function Minimization
newtonInterp

Lagrange and Newtons Interpolation
aitken

Aitken' Method
histc

Histogram Count (Matlab style)
brown72

Brownian Motion
bsxfun

Elementwise Function Application (Matlab Style)
ridders

Ridders' Method
cd, pwd, what

Directory Functions (Matlab style)
qrSolve

LSE Solution
deeve

Event Detection in ODE solution
direct1d

Univariate Global Optimization
Diag

Matrix Diagonal
roots

Polynomial Roots
spinterp

Monotone (Shape-Preserving) Interpolation
circlefit

Fitting a Circle
runs.test

The Runs Test, or Wald-Wolfowitz Test
cotes

Newton-Cotes Formulas
hilb

Hilbert Matrix
kriging

Interpolation by Kriging
lambertWp

Lambert's W Function
eta

Dirichlet Eta Function
lsqnonlin

Nonlinear Least-Squares Fitting
ndims

Number of Dimensions
nearest_spd

Nearest Symmetric Positive-definite Matrix
fminbnd

Finding Function Minimum
findpeaks

Find Peaks
integral2

Numerically Evaluate Double and Triple Integrals
flipdim

Matrix Flipping (Matlab Style)
inv

Matrix Inverse (Matlab Style)
golden_ratio

Golden Ratio Search
pow2

Base 2 Power
rectint

Rectangle Intersection Areas
householder

Householder Reflections
ifft

Inverse Fast Fourier Transformation
L1linreg

L1 Linear Regression
meshgrid

Generate a Mesh Grid
mldivide

Matlab backslash operator
refindall

Find overlapping regular expression matches.
Reshape

Reshape Matrix
rk4, rk4sys

Classical Runge-Kutta
hypot

Hypotenuse Function
mod, rem

Integer Division
strTrim

Remove leading and trailing white space.
rosser

Rosser Matrix
geo_median

Geometric Median
nullspace

Kernel or Nullspace
peaks

Peaks Function (Matlab Style)
polyarea

Area of a Polygon
polar

Polar Coordinate Plot (Matlab Style)
polyApprox

Polynomial Approximation
polyder

Derivative of Polynomial
psi

Psi (Polygamma) Function
primes

Prime Numbers
quad

Adaptive Simpson Quadrature
quad2d

2-d Gaussian Quadrature
numderiv

Richardson's Numerical Derivative
quadl

Adaptive Lobatto Quadrature
rkf54

Runge-Kutta-Fehlberg
quadgk

Adaptive Gauss-Kronrod Quadrature
simpadpt

Adaptive Simpson Quadrature
strjust

Justify character vector
fletcher-powell

Davidon-Fletcher-Powell Method
ratinterp

Rational Interpolation
strcat

String Concatenation
vectorfield

Vector Field Plotting
zeta

Riemann Zeta Function
cot,csc,sec, etc.

More Trigonometric Functions
fsolve

Solve System of Nonlinear Equations
curvefit

Parametric Curve Fit
linspace

Linearly Spaced Sequences
poly2str

Print Polynomial
and, or

Logical AND, OR (Matlab Style)
arclength

Arc Length of a Curve
bvp

Boundary Value Problems
dot

Scalar Product
disp,beep

Utility functions (Matlab style)
deval

Evaluate ODE Solution
ellipke,ellipj

Elliptic and Jacobi Elliptic Integrals
findzeros

Find All Roots
fresnelS/C

Fresnel Integrals
gaussLaguerre

Gauss-Laguerre Quadrature Formula
fzsolve

Complex Root Finding
inpolygon

Polygon Region
lu

LU Matrix Factorization
normest

Estimated Matrix Norm
odregress

Orthogonal Distance Regression
polyfit

Fitting by Polynomial
pascal

Pascal Triangle
ppfit

Piecewise Polynomial Fit
orth

Range Space
rortho

Generate Random Orthogogonal Matrix
squareform

Format Distance Matrix (Matlab Style)
strrep

Find and replace substring
Trace

Matrix trace
simpson2d

Double Simpson Integration
tri

Triangular Matrices (Matlab Style)
trigApprox

Trigonometric Approximation
bisect

Rootfinding Through Bisection
blanks

String of Blank Carakters
cranknic

Crank-Nicolson Method
deconv

Deconvolution
deg2rad

Degrees to Radians
approx_entropy

Approximate Entropy
fact

Factorial Function
gmres

Generalized Minimal Residual Method
hooke-jeeves

Hooke-Jeeves Method
hampel

Hampel Filter
hurst

Hurst Exponent
moler

Moler Matrix
newtonsys

Newton Method for Nonlinear Systems
nnz

Nonzero Elements
newtonHorner

Newton's Root Finding Method for Polynomials.
pchip

Hermitean Interpolation Polynomials
polyadd

Adding Polynomials
piecewise

Piecewise Linear Function
rat

Continuous Fractions (Matlab Style)
randperm

Random Permutation
sqrtm,rootm

Matrix Square and p-th Roots
rref

Reduced Row Echelon Form
regexprep

Replace string using regular expression
subspace

Angle between two subspaces
Toeplitz

Toeplitz Matrix
whittaker

Whittaker Smoothing
wilkinson

wilkinson Matrix
barylag

Barycentric Lagrange Interpolation
nchoosek

Binomial Coefficients
sigmoid

Sigmoid Function
ceil

Integer Functions (Matlab Style)
cond

Matrix Condition
conv

Polynomial Convolution
eig

Eigenvalue Function (Matlab Style)
figure

Control Plot Devices (Matlab Style)
erf

Error Functions and Inverses (Matlab Style)
complexstep

Complex Step Derivation
fnorm

Function Norm
gaussHermite

Gauss-Hermite Quadrature Formula
gcd, lcm

GCD and LCM Integer Functions
hessian

Hessian Matrix
mexpfit

Multi-exponential Fitting
muller

Muller's Method
newtonRaphson

Rootfinding through Newton-Raphson or Secant.
pade

Pade Approximation
perms

Generate Permutations
Poly

Define Polynomial by Roots
procrustes

Solving the Procrustes Problem
runge

Runge Function
quadv

Vectorized Integration
segm_intersect

Segment Intersection
taylor

Taylor Series Approximation
size

Size of Matrix
angle

Basic Complex Functions
compan

Companion Matrix
clear, who(s), ver

Clear function (Matlab style)
clenshaw_curtis

Clenshaw-Curtis Quadrature Formula
distmat

Distance Matrix
eye

Some Basic Matrices
findintervals

Find Interval Indices
fornberg

Fornberg's Finite Difference Approximation
fplot

Plot Multivariate Function
gaussLegendre

Gauss-Legendre Quadrature Formula
gradient

Discrete Gradient (Matlab Style)
horner

Horner's Rule
humps

Matlab Test Functions
jacobian

Jacobian Matrix
itersolve

Iterative Methods
laplacian

Laplacian Operator
magic

Magic Square
polylog

Polylogarithm Function
randcomb

Random Combination
quadgr

Gaussian Quadrature with Richardson Extrapolation
quadcc

Adaptive Clenshaw-Curtis Quadrature
rand

Create Random Matrices
romberg

Romberg Integration
quiver

Quiver or Velocity Plot
sorting

Sorting Routines
rationalfit

Rational Function Approximation
titanium

Titanium Test Data
tic,toc

MATLAB timer functions
chebPoly

Chebyshev Polynomials
gramSchmidt

Gram-Schmidt
interp2

Two-dimensional Data Interpolation
cutpoints

Find Cutting Points
givens

Givens Rotation
legendre

Legendre Functions (Matlab Style)
logspace

Log-linearly Spaced Sequences
polytrans

Polynomial Transformation
polypow

Polynomial Powers
plotyy

Plotting Two y-Axes
rmserr

Accuracy Measures
brent_dekker

Brent-Dekker Root Finding Method
chebCoeff

Chebyshev Polynomials
triquad

Gaussian Triangle Quadrature
trisolve

Tridiagonal Linear System Solver
regexp

Match regular expression
nextpow2

Next Power of 2
std_err

Standard Error
cubicspline

Interpolating Cubic Spline
hadamard

Hadamard Matrix
isempty

isempty Property
geomean, harmmean

Geometric and Harmonic Mean (Matlab Style)
ppval

Piecewise Polynomial Structures
pracma-package

Practical Numerical Math Routines
steepest_descent

Steepest Descent
broyden

Broyden's Method
chebApprox

Chebyshev Approximation
crossn

n-dimensional Vector Cross Product
str2num

Converting string to number (Matlab style)
fibsearch

Fibonacci Search
detrend

Remove Linear Trends
hausdorff_dist

Hausdorff Distance
invperm

Inverse Permutation
lsqlin

Linear Least-Squares Fitting
polyint

Anti-derivative of Polynomial
semilogx,semilogy

Semi-logarithmic Plots (Matlab Style)
strcmp

String Comparison
savgol

Savitzky-Golay Smoothing
numel

Number of Elements
quadinf

Infinite Integrals
accumarray

Accumulate Vector Elements
euler_heun

Euler-Heun ODE Solver
fderiv

Numerical Differentiation
factors

Prime Factors
integral

Adaptive Numerical Integration
movavg

Moving Average Filters
polymul

Multiplying Polynomials
Rank

Matrix Rank
barylag2d

2-D Barycentric Lagrange Interpolation
interp1

One-dimensional Interpolation
lebesgue

Lebesgue Constant
rot90

Matrix Rotation
sortrows

Sort Rows of a Matrix (Matlab Style)
vander

Vandermonde matrix
strfind

Find Substrings
finds

find function (Matlab Style)
abm3pc

Adams-Bashford-Moulton
andrewsplot

Andrews' Curves
fzero

Root Finding
gauss_kronrod

Gauss-Kronrod Quadrature
ezplot

Easy Function Plot
agmean

Arithmetic-geometric Mean
ode23

Runge-Kutta
newmark

Newmark Method
neville

Neville's Method
kron

Kronecker product (Matlab Style)
laguerre

Laguerre's Method
pltcross

Plotting Crosses
coth,csch,sech, etc.

More Hyperbolic Functions
linprog

Linear Programming Solver
softline

Soft (Inexact) Line Search
std

Standard Deviation (Matlab Style)
polyval

Evaluating a Polynomial
segm_distance

Segment Distance
repmat

Replicate Matrix
trigPoly

Trigonometric Polynomial
eigjacobi

Jacobi Eigenvalue Method
findmins

Find All Minima
trapz

Trapezoidal Integration
fminsearch

Minimum Finding
Norm

Vector Norm
pinv

Pseudoinverse or Generalized Inverse