Learn R Programming

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

pracma (version 1.8.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.8.8

License

GPL (>= 3)

Maintainer

Last Published

November 27th, 2015

Functions in pracma (1.8.8)

akimaInterp

Univariate Akima Interpolation
angle

Basic Complex Functions
barylag

Barycentric Lagrange Interpolation
curvefit

Parametric Curve Fit
cutpoints

Find Cutting Points
direct1d

Univariate Global Optimization
deeve

Event Detection in ODE solution
fnorm

Function Norm
findmins

Find All Minima
gaussLaguerre

Gauss-Laguerre Quadrature Formula
hilb

Hilbert Matrix
ifft

Inverse Fast Fourier Transformation
interp2

Two-dimensional Data Interpolation
jacobian

Jacobian Matrix
linspace

Linearly Spaced Sequences
lambertWp

Lambert's W Function
L1linreg

L1 Linear Regression
movavg

Moving Average Filters
Mode

Mode function (Matlab style)
nnz

Nonzero Elements
pascal

Pascal Triangle
Poly

Define Polynomial by Roots
procrustes

Solving the Procrustes Problem
psi

Psi (Polygamma) Function
subspace

Angle between two subspaces
titanium

Titanium Test Data
cart2sph

Coordinate Transformations
complexstep

Complex Step Derivatives
cubicspline

Interpolating Cubic Spline
Diag

Matrix Diagonal
dot

Scalar Product
ezpolar

Easy Polar Plot
eta

Dirichlet Eta Function
fibsearch

Fibonacci Search
factors

Prime Factors
fminsearch

Minimum Finding
fornberg

Fornberg's Finite Difference Approximation
fplot

Plot Multivariate Function
gauss_kronrod

Gauss-Kronrod Quadrature
fzsolve

Complex Root Finding
givens

Givens Rotation
gaussNewton

Gauss-Newton Function Minimization
magic

Magic Square
meshgrid

Generate a Mesh Grid
mldivide

Matlab backslash operator
newmark

Newmark Method
normest

Estimated Matrix Norm
polyint

Anti-derivative of Polynomial
pracma-package

Practical Numerical Math Routines
odregress

Orthogonal Distance Regression
rand

Create Random Matrices
polytrans

Polynomial Transformation
semilogx,semilogy

Semi-logarithmic Plots (Matlab Style)
rref

Reduced Row Echelon Form
steep_descent

Steepest Descent Minimization
trapz

Trapezoidal Integration
strRep

Find and replace substring
wilkinson

wilkinson Matrix
aitken

Aitken' Method
blanks

String of Blank Carakters
euler_heun

Euler-Heun ODE Solver
ezplot

Easy Function Plot
findintervals

Find Interval Indices
gaussLegendre

Gauss-Legendre Quadrature Formula
ellipke,ellipj

Elliptic and Jacobi Elliptic Integrals
flipdim

Matrix Flipping (Matlab Style)
histc

Histogram Count (Matlab style)
hypot

Hypotenuse Function
hooke_jeeves

Hooke-Jeeves Minimization Method
hurstexp

Hurst Exponent
inpolygon

Polygon Region
invlap

Inverse Laplacian
inv

Matrix Inverse (Matlab Style)
bulirsch-stoer

Bulirsch-Stoer Algorithm
moler

Moler Matrix
muller

Muller's Method
mod, rem

Integer Division
lu

LU Matrix Factorization
nearest_spd

Nearest Symmetric Positive-definite Matrix
lsqnonlin

Nonlinear Least-Squares Fitting
polyfit

Fitting by Polynomial
nile

Nile overflow data
piecewise

Piecewise Linear Function
quadl

Adaptive Lobatto Quadrature
qrSolve

LSE Solution
regexprep

Replace string using regular expression
randcomb

Random Combination
size

Size of Matrix
regexp

Match regular expression
std

Standard Deviation (Matlab Style)
vander

Vandermonde matrix
abm3pc

Adams-Bashford-Moulton
circlefit

Fitting a Circle
agmean

Arithmetic-geometric Mean
chebApprox

Chebyshev Approximation
findpeaks

Find Peaks
fresnelS/C

Fresnel Integrals
fzero

Root Finding
lsqlin

Linear Least-Squares Fitting
newtonInterp

Lagrange and Newtons Interpolation
ndims

Number of Dimensions
hampel

Hampel Filter
pade

Pade Approximation
orth

Range Space
poly2str

Print Polynomial
numderiv

Richardson's Numerical Derivative
plotyy

Plotting Two y-Axes
quadinf

Infinite Integrals
quadv

Vectorized Integration
Rank

Matrix Rank
runge

Runge Function
segm_intersect

Segment Intersection
strcat

String Concatenation
trigPoly

Trigonometric Polynomial
pchip

Hermitean Interpolation Polynomials
bisect

Rootfinding Through Bisection
bvp

Boundary Value Problems
bits

Binary Representation
detrend

Remove Linear Trends
crossn

n-dimensional Vector Cross Product
eig

Eigenvalue Function (Matlab Style)
hessian

Hessian Matrix
hausdorff_dist

Hausdorff Distance
interp1

One-dimensional Interpolation
laplacian

Laplacian Operator
nelder_mead

Nelder-Mead Minimization
pinv

Pseudoinverse or Generalized Inverse
rectint

Rectangle Intersection Areas
rationalfit

Rational Function Approximation
rortho

Generate Random Orthogogonal Matrix
rosser

Rosser Matrix
simpadpt

Adaptive Simpson Quadrature
taylor

Taylor Series Approximation
squareform

Format Distance Matrix (Matlab Style)
savgol

Savitzky-Golay Smoothing
triquad

Gaussian Triangle Quadrature
chebCoeff

Chebyshev Polynomials
accumarray

Accumulate Vector Elements
chebPoly

Chebyshev Polynomials
cd, pwd, what

Directory Functions (Matlab style)
combs

Generate Combinations
cotes

Newton-Cotes Formulas
expint

Exponential and Logarithmic Integral
distmat

Distance Matrix
fsolve

Solve System of Nonlinear Equations
gammainc

Incomplete Gamma Function
golden_ratio

Golden Ratio Search
gmres

Generalized Minimal Residual Method
hankel

Hankel Matrix
isprime

isprime Property
peaks

Peaks Function (Matlab Style)
numel

Number of Elements
quad

Adaptive Simpson Quadrature
qpspecial

Special Quadratic Programming Solver
quadgr

Gaussian Quadrature with Richardson Extrapolation
polyval

Evaluating a Polynomial
softline

Soft (Inexact) Line Search
spinterp

Monotone (Shape-Preserving) Interpolation
segm_distance

Segment Distance
trigApprox

Trigonometric Approximation
vectorfield

Vector Field Plotting
std_err

Standard Error
broyden

Broyden's Method
arclength

Arc Length of a Curve
compan

Companion Matrix
simpson2d

Double Simpson Integration
polymul

Multiplying Polynomials
rmserr

Accuracy Measures
bsxfun

Elementwise Function Application (Matlab Style)
deg2rad

Degrees to Radians
dblquad

Double and Triple Integration
errorbar

Plot Error Bars
eps

Floating Point Relative Accuracy
ezcontour,ezmesh

Contour and Mesh Plotter
fletcher-powell

Davidon-Fletcher-Powell Method
gcd, lcm

GCD and LCM Integer Functions
kriging

Interpolation by Kriging
laguerre

Laguerre's Method
newtonsys

Newton Method for Nonlinear Systems
polyadd

Adding Polynomials
pow2

Base 2 Power
quadcc

Adaptive Clenshaw-Curtis Quadrature
quadgk

Adaptive Gauss-Kronrod Quadrature
sigmoid

Sigmoid Function
strTrim

Remove leading and trailing white space.
strjust

Justify character vector
rk4, rk4sys

Classical Runge-Kutta
trisolve

Tridiagonal Linear System Solver
andrewsplot

Andrews' Curves
disp,beep

Utility functions (Matlab style)
barylag2d

2-D Barycentric Lagrange Interpolation
blkdiag

Block Diagonal Matrix
clear, who(s), ver

Clear function (Matlab style)
conv

Polynomial Convolution
cranknic

Crank-Nicolson Method
brown72

Brownian Motion
eye

Some Basic Matrices
einsteinF

Einstein Functions
fact

Factorial Function
fderiv

Numerical Differentiation
findzeros

Find All Roots
finds

find function (Matlab Style)
gramSchmidt

Gram-Schmidt
humps

Matlab Test Functions
coth,csch,sech, etc.

More Hyperbolic Functions
isempty

isempty Property
kron

Kronecker product (Matlab Style)
grad

Numerical Gradient
line_integral

Line integral (in the complex plane)
neville

Neville's Method
legendre

Legendre Functions (Matlab Style)
newtonRaphson

Rootfinding through Newton-Raphson or Secant.
logspace

Log-linearly Spaced Sequences
matlab

Matlab Compatibility
nthroot

Real nth Root
mexpfit

Multi-exponential Fitting
ode23

Non-stiff (and stiff) ODE solvers
perms

Generate Permutations
polyarea

Area of a Polygon
polyApprox

Polynomial Approximation
ppval

Piecewise Polynomial Structures
refindall

Find overlapping regular expression matches.
romberg

Romberg Integration
roots

Polynomial Roots
rot90

Matrix Rotation
sqrtm,rootm

Matrix Square and p-th Roots
ridders

Ridders' Method
sorting

Sorting Routines
polar

Polar Coordinate Plot (Matlab Style)
repmat

Replicate Matrix
cot,csc,sec, etc.

More Trigonometric Functions
fminbnd

Finding Function Minimum
cross

Vector Cross Product
linprog

Linear Programming Solver
deconv

Deconvolution
integral2

Numerically Evaluate Double and Triple Integrals
householder

Householder Reflections
clenshaw_curtis

Clenshaw-Curtis Quadrature Formula
approx_entropy

Approximate and Sample Entropy
lebesgue

Lebesgue Constant
expm

Matrix Exponential
brentDekker

Brent-Dekker Root Finding Algorithm
gaussHermite

Gauss-Hermite Quadrature Formula
halley

Halley's Root Finding Mathod
ceil

Integer Functions (Matlab Style)
deval

Evaluate ODE Solution
and, or

Logical AND, OR (Matlab Style)
horner

Horner's Rule
geo_median

Geometric Median
polyder

Derivative of Polynomial
nextpow2

Next Power of 2
nchoosek

Binomial Coefficients
Reshape

Reshape Matrix
tri

Triangular Matrices (Matlab Style)
nullspace

Kernel or Nullspace
quad2d

2-d Gaussian Quadrature
histss

Histogram Bin-width Optimization
erf

Error Functions and Inverses (Matlab Style)
polypow

Polynomial Powers
newtonHorner

Newton's Root Finding Method for Polynomials.
itersolve

Iterative Methods
charpoly

Characteristic Polynomial
strfind

Find Substrings
primes

Prime Numbers
figure

Control Plot Devices (Matlab Style)
ratinterp

Rational Interpolation
hadamard

Hadamard Matrix
cond

Matrix Condition
whittaker

Whittaker Smoothing
integral

Adaptive Numerical Integration
sortrows

Sort Rows of a Matrix (Matlab Style)
Trace

Matrix trace
polylog

Polylogarithm Function
ppfit

Piecewise Polynomial Fit
strcmp

String Comparison
gradient

Discrete Gradient (Matlab Style)
gammaz

Complex Gamma Function
sumalt

Alternating Series Acceleration
zeta

Riemann Zeta Function
geomean, harmmean

Geometric and Harmonic Mean (Matlab Style)
Norm

Vector Norm
str2num

Converting string to number (Matlab style)
randperm

Random Permutation
rat

Continuous Fractions (Matlab Style)
rkf54

Runge-Kutta-Fehlberg
bernoulli

Bernoulli Numbers and Polynomials
eigjacobi

Jacobi Eigenvalue Method
quiver

Quiver or Velocity Plot
tic,toc

MATLAB timer functions
Toeplitz

Toeplitz Matrix