The NAG Toolbox for MATLAB ®


The NAG Toolbox for MATLAB is the largest and most comprehensive single numerical toolkit that both complements and enhances MATLAB. The NAG Toolbox for MATLAB contains over 1,500 functions that provide solutions to a vast range of mathematical and statistical problems. The functionality contained within this toolbox gives a 'one-stop' solution to your numerical computational needs.

What's new at Mark 24?

Key Features

Maths and Stats Functionality

NAG's collection of world-class numerical functions which now includes newly developed functionality designed to address many areas including: global optimization, Linear Quantile Regression and option pricing as well as further extensions in established areas such as statistics, local optimization, linear algebra, ordinary differential equations, regression, random number generation and special functions.

Global Optimization Example

User's Comments

"I really like the NAG Toolbox for MATLAB for the following reasons (among others): It can speed up MATLAB calculations (see my article on MATLAB's interp1 function for example), and it has some functionality that can't currently be found in MATLAB."
Michael Croucher, University of Manchester (visit Michael's blog for interesting articles, white papers and related discussion).

"I am impressed by the optimization algorithm provided by the NAG Toolbox for MATLAB. It improves the results for my maximum likelihood estimations for situations where the sample size is small causing non-concentrating likelihood and when the likelihood functions have 'ridges'. Ordinary algorithms, for example Newton gradient search, perform poorly in these situations."
Ning Guo, Warwick Finance Research Institute, University of Warwick, UK

Using the NAG Toolbox for MATLAB strengthens user capability in numerical and statistical areas such as:

Optimization-both local and global optimization solvers (minimization and maximization – finding the optimum)
Ordinary and partial differential equations
Option pricing
Partial least squares and ridge regression
Nearest correlation matrix
Mesh generation
Numerical integration
Roots of nonlinear equations
Dense, banded and sparse linear equations
Eigenvalue problems
Linear and nonlinear least squares problems
Special functions
Curve and surface fitting and interpolation
Large scale eigenproblems
Large, sparse systems of linear equations
Random number generation
Simple calculations of statistical data
Correlation and regression analysis
Multivariate methods
Analysis of variance and contingency table analysis
Time series analysis
Nonparametric statistics

Detailed Documentation

Each function is accompanied by comprehensive documentation along with advice on selecting the best algorithms and interpreting the results returned.

Regular Updates

To ensure that we meet your existing and future requirements, the NAG Toolbox for MATLAB is regularly updated with new and enhanced algorithms for use in evolving business areas, learning and research.

Online Documentation

The software in the NAG Toolbox for MATLAB is accompanied by first-class electronic help giving you the detailed information you need to carry out your work quickly and effectively.

Using equivalent algorithms from C, .NET and Fortran

The algorithms that comprise the Toolbox are also available in a C Library, a .NET Library and a Fortran Library, format that can be called from many environments, as well as in high performance parallel forms. Users can port solutions into performance and production applications and still maintain the best numerical accuracy.

Expert Support

Subscription to our dedicated Technical Support Service includes automatic notification of updates and access to our domain experts who are there to assist you with your technical queries or difficulties.

Quality Assurance

The validity of each Toolbox function is tested on each of the machine ranges for which the NAG Toolbox for MATLAB is available. Only when an implementation satisfies our stringent accuracy standards is it released. As a result, you can rely on the proven accuracy and reliability of the functions to give you the right answers.


One of the key benefits to MATLAB users using the NAG Toolbox for MATLAB is the extensive routine documentation for every routine accessible from the Toolbox. Included in the documentation for each NAG Library routine is example MATLAB code showing how to call the routine.

The NAG Toolbox for MATLAB Manual, Mark 24

To illustrate how easy the NAG Toolbox for MATLAB is to use, we demonstrate how to call some popular NAG routines, and use MATLAB's plotting facilities to view the results below.

NAG Toolbox for MATLAB Example

Derived from NAG Chapter            

Finding the root of an equation

The C05 chapter

Interpolation through a set of points

The E01 Chapter

Fitting a surface with bicubic splines

The E02 Chapter

Fitting a set of points with a cubic spline

The E02 Chapter

Minimization of a function

The E04 Chapter


The D01 chapter

Creating a Gaussian copula

The G Chapter

Multivariate Methods

The G03 chapter

Random Number Generators

The G05 chapter

Time series analysis

The G13 chapter

Bessel functions

The S Chapter

Previous marks of the NAG Toolbox for MATLAB Manual are still available: Mark 23, Mark 22 and Mark 21.

Product Availability

Product Availability and Compatibility

New to NAG?

If you've never used NAG software before there are various purchase options that enable use of the NAG Toolbox for MATLAB®. To find out about these please email or telephone us for more details.

Existing NAG Library user availability

If you currently hold a supported licence to use the NAG C Library, NAG Fortran Library or NAG Library for SMP & Multicore, (or have access to it via a site wide licence), you may be entitled to receive an upgrade of the NAG Toolbox for MATLAB®*. For more information on your eligibility please email or call us.

* For installation on the same machine, i.e. current supported NAG C Library Windows 32 bit development licence = upgrade to NAG Toolbox for MATLAB® Windows 32 bit version.

Product Availability

Your Platform MATLAB 2012a/b, 2011a/b, 2010b MATLAB 2013a MATLAB 2013b, R2014a

Microsoft Windows

NAG Toolbox for MATLAB, Mark 23 (product code MBW6A23DJL) NAG Toolbox for MATLAB, Mark 24 (product code MBW6I24DDL) NAG Toolbox for MATLAB, Mark 24 (product code MBW6I24DDL)
Microsoft Windows
NAG Toolbox for MATLAB, Mark 23 (product code MBW3223DCL) NAG Toolbox for MATLAB, Mark 24 (product code MBW3224DCL) NAG Toolbox for MATLAB, Mark 24 (product code MBW3224DCL)
NAG Toolbox for MATLAB, Mark 23 (product code: MBL6A23DML) NAG Toolbox for MATLAB, Mark 24 (product code: MBL6I24DML) NAG Toolbox for MATLAB, Mark 24 (product code: MBL6A24DNL)
NAG Toolbox for MATLAB, Mark 23 (product code: MBLUX23DML) No longer supported by MATLAB
Apple Mac
NAG Toolbox for MATLAB, Mark 23 (product code: MBMI623DDL) NAG Toolbox for MATLAB, Mark 24 Coming Soon Coming Soon

*Linux 32bit no longer supported by MATLAB after R2012a.

Website Feedback

If you would like a response from NAG please provide your e-mail address below.

(If you're a human, don't change the following field)
Your first name.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Enter the characters shown in the image.