Write Unit Tests

Assemble test methods into test-case classes

The matlab.unittest package is an xUnit-style, unit-testing framework for MATLAB®. To test a MATLAB program, write a test case using qualifications, which are methods for testing values and responding to failures. The test case contains test functions and test fixtures (setup and teardown code).


functiontests Create array of tests from handles to local functions


matlab.unittest.TestCase Superclass of all matlab.unittest test classes
matlab.unittest.Verbosity Verbosity level enumeration class


matlab.unittest Summary of packages and classes in MATLAB Unit Test Framework
matlab.unittest.constraints Summary of classes in MATLAB Constraints Interface
matlab.unittest.diagnostics Summary of classes in MATLAB Diagnostics Interface
matlab.unittest.fixtures Summary of classes in MATLAB Fixtures Interface
matlab.unittest.qualifications Summary of classes in MATLAB Qualifications Interface
Was this topic helpful?