For MATLAB R2024b or older, use the legacy MLX release.
Curriculum Module
Created with R2025a. Compatible with R2025a and later releases.
This curriculum module contains interactive MATLAB® live scripts that analyze genetic data.
You can use these live scripts as demonstrations in lectures, class activities, or interactive assignments outside class. This module covers calculating the statistics of a single DNA sequence, uses real genetic data to create a phylogenetic tree, and explores within-species genetic variation.
This module utilizes data pulled from GenBank, the NIH's library of publicly available genetic sequences.
An internet connection is needed for GenBank sequence retrieval and the initial download of the primates example. Downloaded data belongs in Data/ and is excluded from version control. Population data is simulated locally.
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
Stop button in the RUN section of the Live Editor tab in the MATLAB Toolstrip.
Contact the MathWorks Educator Content Development Team if you would like to request assistance, provide feedback, or if you have a question.
This module assumes basic MATLAB knowledge and it is recommended that all students take the MATLAB Onramp.
To learn more about opening and using MATLAB, see the accompanying Getting Started guide.
Use MATLAB R2025a or newer for these plain-text live scripts. For MATLAB R2024b or older, download the legacy .mlx release.
Use the
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.
Download or clone this repository. Open MATLAB, navigate to the folder containing these scripts and double-click on BiosciencesGenetics.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
Add-Ons > Get Add-Ons.
MATLAB®, Bioinformatics Toolbox™, and the Statistics and Machine Learning Toolbox™ are used throughout. The Mapping Toolbox™ is used for changem().
Notes: These scripts can all be run independently, though we recommend going through these live scripts in order. These live scripts are intended to be used with output inline. To change the output, go to the View tab of the toolstrip, and select
Output Inline. The scripts have areas for the students to interact with the code
.
|
In this script, students will... |
Academic disciplines |
1) an example of phylogenetic trees using the primate dataset
2) an example of using phylogenetic trees to understand a disease
3) more on sequence statistics
| Courseware |
Location |
|
|---|---|---|
| Biosciences: Working With Data |
|
Available on: GitHub |
| Biosciences: Statistical Methods |
|
Available on: GitHub |
| Biosciences: Image Processing |
|
Available on: GitHub |
| Biosciences: Machine Learning |
|
Available on: GitHub |
Or feel free to explore our other modular courseware content.
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.
The license for this project is in the LICENSE.md file in this repository.
Share your feedback to help us improve this module.
© Copyright 2023-2026 The MathWorks, Inc.









