Skip to content

MathWorks-Teaching-Resources/Regression-Basics

Regression Basics

View on File Exchange or Open in MATLAB Online

MATLAB Versions Tested

Curriculum Module

Created with R2026a. Compatible with R2026a and later releases.

Information

This curriculum module contains an interactive MATLAB® live script that illustrates some basic concepts of regression analysis.

Background

You can use this live script as a demonstration in lectures, a class activity, or an interactive assignment outside class. This module covers topics including simple regression, multiple regression, and curvilinear regression applied to engineering topics.

The instructions inside the live script will guide you through the exercises and activities. Get started with the 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 image_0.png Stop button in the RUN section of the Live Editor tab in the MATLAB Toolstrip.

Contact Us

Contact the MathWorks Educator Content Development Team if you would like to provide feedback, or if you have a question.

Prerequisites

This module assumes knowledge of plotting and working with linear data, basic programming in MATLAB, knowledge of multivariate calculus and familiarity with linear algebra.

Getting Started

Accessing the Module

On MATLAB Online:

Use the image_1.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 RegressionBasics.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 image_2.png Add-Ons > Get Add-Ons.

Products

MATLAB® is used throughout. Tools from Statistics and Machine Learning Toolbox™, Curve Fitting Toolbox™, and Symbolic Math Toolbox™. are used frequently as well.

Scripts

image_3.png
In this script, students will...
$\bullet$ explain and apply simple linear regression models.
$\bullet$ evaluate and interpret regression results using residuals and model coefficients.
$\bullet$ build multiple linear regression models and assess model fit using visual and analytical methods.
Academic disciplines
$\bullet$ Math
$\bullet$ Statistics
$\bullet$ Data Science
$\bullet$ Biomedical Devices
$\bullet$ Machine Learning

image_4.svg
In this script, students will...
$\bullet$ explain curvilinear regression and when to use it.
$\bullet$ distinguish and apply polynomial and linearizable nonlinear models.
$\bullet$ explain curvilinear regression and identify contexts where it is most suitable.
Academic disciplines
$\bullet$ Math
$\bullet$ Statistics
$\bullet$ Data Science
$\bullet$ Machine Learning
$\bullet$ Electrochemistry/Chemical Engineering
$\bullet$ Electrical Engineering

image_5.png
In this script, students will...
$\bullet$ explain multiple linear regression and identify response and predictor variables.
$\bullet$ check linearity assumptions using scatterplots and residual diagnostics.
$\bullet$ fit and use a multiple regression model to interpret coefficients and make predictions.
Academic disciplines
$\bullet$ Math
$\bullet$ Statistics
$\bullet$ Data Science
$\bullet$ Machine Learning
$\bullet$ Chemical Engineering
$\bullet$ Electrical Engineering

Related Courseware Modules

image_6.png
Available on:
image_7.pngimage_8.png
GitHub

image_9.png
Available on:
image_10.pngimage_11.png
GitHub

Or feel free to explore our other modular courseware content.

Educator Resources

Contribute

Looking for more? Find an issue? Have a suggestion? Please contact the MathWorks Educator Content Development Team. If you want to contribute directly to this project, you can find information about how to do so in the CONTRIBUTING.md page on GitHub.

© Copyright 2026 The MathWorks, Inc

About

Interactive courseware module that addresses the fundamentals of regression analysis taught in STEM courses.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages