Use the xUnit-style MATLAB Unit Testing Framework to write, run, and analyze tests for your MATLAB programs. You can define how each test checks values and responds to failures. Use setup and teardown code to establish the pretest state of the system and, after testing, to restore the system to the original state. Run tests individually or grouped into a test suite. For more information watch MATLAB Unit Testing FrameworkMATLAB Unit Testing Framework.