Create MATLAB Tests
Since R2023a
Use MATLAB Test™ to automatically create tests for source code from a file or from the history of code execution in the MATLAB Command Window. Create baseline tests to validate your MATLAB code against previously inspected data.
MATLAB Test extends the test authoring capabilities of the MATLAB unit testing framework. For more information on how MATLAB Test enhances the functionality provided by MATLAB apps, classes, and functions, see Extend MATLAB Unit Testing Framework with MATLAB Test.
Classes
matlabtest.parameters.BaselineParameter | Baseline parameter (Since R2024b) |
matlabtest.baselines.MATFileBaseline | Representation of baseline data stored in MAT file (Since R2024b) |
matlabtest.constraints.EqualsBaseline | Test if value is equal to baseline data (Since R2024b) |
Functions
matlabtest.parameters.matfileBaseline | Define data in MAT file as baseline data (Since R2024b) |
verifyEqualsBaseline | Verify value is equal to baseline data (Since R2024b) |
Topics
- Create Starter Tests for MATLAB Source Code
Generate a starter test class that exercises your script, function, or class. Use the class as a starting point for adding more tests. (Since R2024a)
- Generate Tests for MATLAB Source Code
Generate unit tests that exercise your MATLAB source code or equivalence tests that build and exercise generated code. (Since R2025a)
- Create Baseline Tests for MATLAB Code
Verify that a MATLAB function continues to produce the same outputs by creating and running a baseline test. (Since R2024b)
