File Exchange

image thumbnail


version (8.7 KB) by Timothy Wall
xUnit unit test framework for MATLAB

1 Download

Updated 06 Jul 2005

No License

Provide automatic testing of m-file functions. Captures and resports test execution, failure, and errors.

Automatically collects multiple tests written in a single file into a suite of tests.

Cite As

Timothy Wall (2021). MATUnit (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)

Matthew Davidson

Lacks setup and teardown facilities. Code could be broken down into smaller chunks.

Does Itmatter

Very cleanly written code

Andrew Newell

In R14, each call to the command
tests = str2func(suite([mfilename '.m']));
gets the following warning:

Warning: Non-scalar arrays of function handles will continue to work in R14, but will be illegal in R15, to support parenthesis notation for invocation of function handles. To prepare for R15, and to avoid this warning, use cell arrays of function handles instead of arrays. For more information, type 'help function_handle' and see the section at the end entitled Note on Backward Compatibility.

Timothy Wall

Bug: if the name of your test suite file starts with "test" it'll recursively loop and not provide any useful results. the workaround is to name your main file something like MyTests or DSPTest.

MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Unit testing tools

Community Treasure Hunt

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

Start Hunting!