Teach numerical methods for interpolation, differentiation, integration, and solving ODEs and PDEs with MATLAB.
Updated 23 May 2024

Numerical Methods with Applications

View on File Exchange or Open in MATLAB Online

MATLAB Versions Tested

Curriculum Module

Created with R2021b. Compatible with R2021b and later releases.


This curriculum module contains interactive MATLAB® live scripts that teach fundamental concepts and basic terminology related to designing and implementing numerical methods related to interpolation, numerical integration and differentiation, and numerical solutions to ordinary and partial differential equations.


You can use these live scripts as demonstrations in lectures, class activities, or interactive assignments outside class. This module addresses standard topics from a first course in numerical methods including interpolation, numerical integration and derivation, and several numerical solution methods for ODEs and PDEs.

The instructions inside the live scripts will guide you through the exercises and activities. Get started with each live script by running it one section at a time. To stop running the script or a section midway (for example, when an animation is in progress), use the EndIcon.png Stop button in the RUN section of the Live Editor tab in the MATLAB Toolstrip.

Contact Us

Solutions are available upon instructor request. Contact the MathWorks teaching resources team if you would like to request solutions, provide feedback, or if you have a question.


This module assumes familiarity with basic programming concepts such as floating-point doubles and strings, structures including constants, vectors, matrices, arrays, control flows including if/else, for loops, and while loops, and how to use them in MATLAB. These ideas are all presented with interactive examples in Fundamentals of Programming. This module assumes familiarity with polynomials, derivatives, and integrals. To use the partial differential equation scripts, a student must be familiar with the concepts of partial derivatives and multivariable functions. These scripts do not assume knowledge of analytic solutions to ordinary or partial differential equations.

Getting Started

Accessing the Module

On MATLAB Online:

Use the OpenInMO.png link to download the module. You will be prompted to log in or create a MathWorks account. The project will be loaded, and you will see an app with several navigation options to get you started.

On Desktop:

Download or clone this repository. Open MATLAB, navigate to the folder containing these scripts and double-click on NumerialMethods.prj. It will add the appropriate files to your MATLAB path and open an app that asks you where you would like to start.

Ensure you have all the required products (listed below) installed. If you need to include a product, add it using the Add-On Explorer. To install an add-on, go to the Home tab and select AddOnsIcon.png Add-Ons > Get Add-Ons.


MATLAB® is used throughout. Tools from the Symbolic Math Toolbox™ are used frequently as well.

  • drawpolygon from Image Processing and Computer Vision™ is used to create datasets in Hand.mlx and MeasureLakeArea.mlx
  • Statistics and Machine Learning Toolbox™ and the Curve Fitting Toolbox™ are used in Interpolation.mlx
  • geoplayer from Automated Driving Toolbox™ is used in TrackStorms.mlx to create elegant visualizations, but pedagogically similar plots are demonstrated with geoplot as well.


In this script, students will...

- define interpolation and explain how it is different from regression and extrapolation
- demonstrate multiple solutions to an interpolation problem, even when interpolating by polynomials
- implement three different interpolation functions
- Drawing a smooth rendition of their hand
- Tracking the path of a cyclone

Scaffolded Template Scripts

Supporting Scripts

In this script, students will...

- determine numerical derivative approximations formulas
- use Taylor's theorem to calculate the order of the error for a numerical approximation to a derivative
- demonstrate how numerical derivatives can magnify approximation errors
- Numerical solutions to differential equations
In this script, students will...

- implement Euler's method, Gaussian 2-point approximations, and Simpson's rule for numerical integration
- explain why higher-order approximations may not be appropriate in applications
- Measure the area of a lake

Scaffolded Template Scripts

Supporting Scripts

In this script, students will...

- implement Euler's method for first-order initial value problems
- calculate the error of their numerical solution
- implement a trapezoidal method
- implement a four-step Runge-Kutta method
- compare results with the built-in MATLAB solver ode45
- Model a pendulum with increasingly realistic assumptions

Scaffolded Template Scripts

Supporting Scripts

In this script, students will...

- identify errors from discretizing the problem and from discretizing the method and choose appropriate parameters to minimize overall error
- explain the importance of stability when choosing a numerical method
- implement explicit, implicit, and Crank-Nicolson methods to solve a 1-D heat equation
- Solve a heat equation

Scaffolded Template Scripts


The license for this module is available in the

Related Courseware Modules

Courseware Module
Sample Content
Available on:
Applied Linear Algebra

Programming: Structuring Code
Learn how to organize your code into functions,
debug, comment, and share




Or feel free to explore our other modular courseware content.

Educator Resources


Looking for more? Find an issue? Have a suggestion? Please contact the MathWorks teaching resources team. If you want to contribute directly to this project, you can find information about how to do so in the page on GitHub.

© Copyright 2024 The MathWorks™, Inc

Cite As

Emma Smith Zbarsky (2024). Numerical-Methods-with-Applications (, GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2021b
Compatible with R2021b and later releases
Platform Compatibility
Windows macOS Linux
Find more on Mathematics and Optimization in Help Center and MATLAB Answers
More Files in the  Distance Learning Community

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

See release notes for this release on GitHub:


See release notes for this release on GitHub:

See release notes for this release on GitHub:

See release notes for this release on GitHub:

See release notes for this release on GitHub:


See release notes for this release on GitHub:


See release notes for this release on GitHub:


See release notes for this release on GitHub:


See release notes for this release on GitHub:


See release notes for this release on GitHub:


See release notes for this release on GitHub:


See release notes for this release on GitHub:


To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.