Learn R Programming

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

pracma (version 1.7.0)

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

License

GPL (>= 3)

Maintainer

Last Published

July 1st, 2014

Functions in pracma (1.7.0)

arclength

Arc Length of a Curve
clenshaw_curtis

Clenshaw-Curtis Quadrature Formula
charpoly

Characteristic Polynomial
combs

Generate Combinations
complexstep

Complex Step Derivatives
chebPoly

Chebyshev Polynomials
cotes

Newton-Cotes Formulas
cross

Vector Cross Product
direct1d

Univariate Global Optimization
distmat

Distance Matrix
errorbar

Plot Error Bars
fminsearch

Minimum Finding
einsteinF

Einstein Functions
hadamard

Hadamard Matrix
givens

Givens Rotation
gaussHermite

Gauss-Hermite Quadrature Formula
horner

Horner's Rule
kron

Kronecker product (Matlab Style)
itersolve

Iterative Methods
linspace

Linearly Spaced Sequences
lu

LU Matrix Factorization
geomean, harmmean

Geometric and Harmonic Mean (Matlab Style)
nchoosek

Binomial Coefficients
perms

Generate Permutations
poly2str

Print Polynomial
polytrans

Polynomial Transformation
ppval

Piecewise Polynomial Structures
procrustes

Solving the Procrustes Problem
quad

Adaptive Simpson Quadrature
quadgr

Gaussian Quadrature with Richardson Extrapolation
quadgk

Adaptive Gauss-Kronrod Quadrature
quadl

Adaptive Lobatto Quadrature
roots

Polynomial Roots
Toeplitz

Toeplitz Matrix
titanium

Titanium Test Data
strTrim

Remove leading and trailing white space.
bisect

Rootfinding Through Bisection
abm3pc

Adams-Bashford-Moulton
detrend

Remove Linear Trends
eta

Dirichlet Eta Function
findmins

Find All Minima
fplot

Plot Multivariate Function
fsolve

Solve System of Nonlinear Equations
gaussLegendre

Gauss-Legendre Quadrature Formula
gaussLaguerre

Gauss-Laguerre Quadrature Formula
gramSchmidt

Gram-Schmidt
interp2

Two-dimensional Data Interpolation
mldivide

Matlab backslash operator
mexpfit

Multi-exponential Fitting
line_integral

Line integral (in the complex plane)
ndims

Number of Dimensions
odregress

Orthogonal Distance Regression
polymul

Multiplying Polynomials
Rank

Matrix Rank
regexp

Match regular expression
segm_intersect

Segment Intersection
softline

Soft (Inexact) Line Search
strjust

Justify character vector
subspace

Angle between two subspaces
wilkinson

wilkinson Matrix
strcat

String Concatenation
ceil

Integer Functions (Matlab Style)
barylag2d

2-D Barycentric Lagrange Interpolation
cart2sph

Coordinate Transformations
chebCoeff

Chebyshev Polynomials
ezcontour,ezmesh

Contour and Mesh Plotter
findpeaks

Find Peaks
gmres

Generalized Minimal Residual Method
gradient

Discrete Gradient (Matlab Style)
householder

Householder Reflections
inpolygon

Polygon Region
hypot

Hypotenuse Function
moler

Moler Matrix
disp,beep

Utility functions (Matlab style)
cond

Matrix Condition
nullspace

Kernel or Nullspace
cranknic

Crank-Nicolson Method
pade

Pade Approximation
rk4, rk4sys

Classical Runge-Kutta
dblquad

Double and Triple Integration
dot

Scalar Product
eigjacobi

Jacobi Eigenvalue Method
regexprep

Replace string using regular expression
rand

Create Random Matrices
rref

Reduced Row Echelon Form
sortrows

Sort Rows of a Matrix (Matlab Style)
angle

Basic Complex Functions
steepest_descent

Steepest Descent
deg2rad

Degrees to Radians
trisolve

Tridiagonal Linear System Solver
blanks

String of Blank Carakters
akimaInterp

Univariate Akima Interpolation
blkdiag

Block Diagonal Matrix
circlefit

Fitting a Circle
compan

Companion Matrix
figure

Control Plot Devices (Matlab Style)
fletcher-powell

Davidon-Fletcher-Powell Method
gammaz

Complex Gamma Function
findintervals

Find Interval Indices
expint

Exponential and Logarithmic Integral
grad

Numerical Gradient
invlap

Inverse Laplacian
fzsolve

Complex Root Finding
nearest_spd

Nearest Symmetric Positive-definite Matrix
newtonHorner

Newton's Root Finding Method for Polynomials.
geo_median

Geometric Median
nnz

Nonzero Elements
hampel

Hampel Filter
kriging

Interpolation by Kriging
magic

Magic Square
mod, rem

Integer Division
polar

Polar Coordinate Plot (Matlab Style)
nthroot

Real nth Root
newmark

Newmark Method
nextpow2

Next Power of 2
pow2

Base 2 Power
polyder

Derivative of Polynomial
primes

Prime Numbers
polyarea

Area of a Polygon
qrSolve

LSE Solution
quad2d

2-d Gaussian Quadrature
ppfit

Piecewise Polynomial Fit
rectint

Rectangle Intersection Areas
simpson2d

Double Simpson Integration
tic,toc

MATLAB timer functions
refindall

Find overlapping regular expression matches.
rationalfit

Rational Function Approximation
rkf54

Runge-Kutta-Fehlberg
ridders

Ridders' Method
Trace

Matrix trace
segm_distance

Segment Distance
trigApprox

Trigonometric Approximation
romberg

Romberg Integration
simpadpt

Adaptive Simpson Quadrature
spinterp

Monotone (Shape-Preserving) Interpolation
sqrtm,rootm

Matrix Square and p-th Roots
sorting

Sorting Routines
isempty

isempty Property
zeta

Riemann Zeta Function
brentDekker

Brent-Dekker Root Finding Algorithm
cd, pwd, what

Directory Functions (Matlab style)
clear, who(s), ver

Clear function (Matlab style)
crossn

n-dimensional Vector Cross Product
deconv

Deconvolution
cubicspline

Interpolating Cubic Spline
ellipke,ellipj

Elliptic and Jacobi Elliptic Integrals
ezpolar

Easy Polar Plot
ezplot

Easy Function Plot
fact

Factorial Function
coth,csch,sech, etc.

More Hyperbolic Functions
fzero

Root Finding
interp1

One-dimensional Interpolation
integral2

Numerically Evaluate Double and Triple Integrals
lsqlin

Linear Least-Squares Fitting
laplacian

Laplacian Operator
matlab

Matlab Compatibility
ode23

Non-stiff ODE solvers
orth

Range Space
numderiv

Richardson's Numerical Derivative
pascal

Pascal Triangle
Norm

Vector Norm
polyApprox

Polynomial Approximation
agmean

Arithmetic-geometric Mean
polypow

Polynomial Powers
conv

Polynomial Convolution
brown72

Brownian Motion
aitken

Aitken' Method
curvefit

Parametric Curve Fit
whittaker

Whittaker Smoothing
quadv

Vectorized Integration
deeve

Event Detection in ODE solution
strfind

Find Substrings
hilb

Hilbert Matrix
expm

Matrix Exponential
fresnelS/C

Fresnel Integrals
findzeros

Find All Roots
gammainc

Incomplete Gamma Function
golden_ratio

Golden Ratio Search
halley

Halley's Root Finding Mathod
fminbnd

Finding Function Minimum
inv

Matrix Inverse (Matlab Style)
jacobian

Jacobian Matrix
L1linreg

L1 Linear Regression
linprog

Linear Programming Solver
meshgrid

Generate a Mesh Grid
pinv

Pseudoinverse or Generalized Inverse
polyfit

Fitting by Polynomial
randperm

Random Permutation
quiver

Quiver or Velocity Plot
rortho

Generate Random Orthogogonal Matrix
trigPoly

Trigonometric Polynomial
strcmp

String Comparison
vander

Vandermonde matrix
legendre

Legendre Functions (Matlab Style)
barylag

Barycentric Lagrange Interpolation
bsxfun

Elementwise Function Application (Matlab Style)
erf

Error Functions and Inverses (Matlab Style)
eig

Eigenvalue Function (Matlab Style)
gaussNewton

Gauss-Newton Function Minimization
eps

Floating Point Relative Accuracy
histss

Histogram Bin-width Optimization
humps

Matlab Test Functions
integral

Adaptive Numerical Integration
isprime

isprime Property
hankel

Hankel Matrix
laguerre

Laguerre's Method
lebesgue

Lebesgue Constant
logspace

Log-linearly Spaced Sequences
newtonsys

Newton Method for Nonlinear Systems
normest

Estimated Matrix Norm
piecewise

Piecewise Linear Function
polylog

Polylogarithm Function
psi

Psi (Polygamma) Function
quadcc

Adaptive Clenshaw-Curtis Quadrature
randcomb

Random Combination
quadinf

Infinite Integrals
rmserr

Accuracy Measures
Reshape

Reshape Matrix
runs.test

The Runs Test, or Wald-Wolfowitz Test
str2num

Converting string to number (Matlab style)
trapz

Trapezoidal Integration
triquad

Gaussian Triangle Quadrature
accumarray

Accumulate Vector Elements
broyden

Broyden's Method
chebApprox

Chebyshev Approximation
deval

Evaluate ODE Solution
Diag

Matrix Diagonal
eye

Some Basic Matrices
approx_entropy

Approximate and Sample Entropy
fderiv

Numerical Differentiation
factors

Prime Factors
fornberg

Fornberg's Finite Difference Approximation
flipdim

Matrix Flipping (Matlab Style)
fnorm

Function Norm
hooke-jeeves

Hooke-Jeeves Method
lambertWp

Lambert's W Function
invperm

Inverse Permutation
Mode

Mode function (Matlab style)
nelder_mead

Nelder-Mead Minimization Method
newtonInterp

Lagrange and Newtons Interpolation
newtonRaphson

Rootfinding through Newton-Raphson or Secant.
numel

Number of Elements
plotyy

Plotting Two y-Axes
peaks

Peaks Function (Matlab Style)
Poly

Define Polynomial by Roots
polyint

Anti-derivative of Polynomial
polyval

Evaluating a Polynomial
ratinterp

Rational Interpolation
rosser

Rosser Matrix
sigmoid

Sigmoid Function
runge

Runge Function
size

Size of Matrix
squareform

Format Distance Matrix (Matlab Style)
std_err

Standard Error
std

Standard Deviation (Matlab Style)
strrep

Find and replace substring
tri

Triangular Matrices (Matlab Style)
cot,csc,sec, etc.

More Trigonometric Functions
vectorfield

Vector Field Plotting
rot90

Matrix Rotation
andrewsplot

Andrews' Curves
and, or

Logical AND, OR (Matlab Style)
bvp

Boundary Value Problems
cutpoints

Find Cutting Points
euler_heun

Euler-Heun ODE Solver
fibsearch

Fibonacci Search
finds

find function (Matlab Style)
gauss_kronrod

Gauss-Kronrod Quadrature
gcd, lcm

GCD and LCM Integer Functions
hessian

Hessian Matrix
hausdorff_dist

Hausdorff Distance
histc

Histogram Count (Matlab style)
hurst

Hurst Exponent
ifft

Inverse Fast Fourier Transformation
muller

Muller's Method
lsqnonlin

Nonlinear Least-Squares Fitting
movavg

Moving Average Filters
neville

Neville's Method
pchip

Hermitean Interpolation Polynomials
polyadd

Adding Polynomials
pracma-package

Practical Numerical Math Routines
rat

Continuous Fractions (Matlab Style)
repmat

Replicate Matrix
savgol

Savitzky-Golay Smoothing
semilogx,semilogy

Semi-logarithmic Plots (Matlab Style)
taylor

Taylor Series Approximation