MATLAB Exercise Assessment Tests in MATLAB Course Designer
Use assessments to automatically test learner solutions to MATLAB® Exercises in MATLAB Course Designer™.

For an example of how to create a MATLAB Exercise, including assessment tests, see Create MATLAB Exercise Using MATLAB Course Designer.
Create Assessment Test
Open your course in MATLAB Course Designer. Navigate to an exercise and click Edit. To open the Edit Exercise window, where you can add assessments to this exercise, click Edit Exercise.
Click Tests in the left navigation pane. The Test pane opens.
To add assessments, you must have a solution. Click Run Solution to generate the workspace variables that the tests can access. You can rerun the reference solution to regenerate the workspace variables at any time. Running the reference solution does not remove any variables from your workspace.
When a learner submits a solution to a MATLAB Exercise, the software runs the learner solution and the reference solution and compares them using the tests you specify.
You can choose different types of tests from the Add Test list.
Is Function/Keyword Absent? — Check that the learner solution does not include the specified function or keyword.
Is Function/Keyword Present? — Check that the learner solution includes the specified function or keyword.
Is Variable Correct? — Check that the specified variable is correct up to the specified tolerance. You can specify any variable from your workspace.
To specify multiple functions or keywords in a single test, separate them with commas.
To specify the tolerance for a correctness test, expand the Tolerance pane. You can set both the relative and absolute tolerance. The software uses the weaker constraint. That is, the tolerance the software uses is:
|xlearner-xsolution| ≤ max( (absolute tolerance), (relative tolerance) × max(xlearner, xsolution) ),
where xlearner is the specified variable created by the learner solution and xsolution is the same variable created by the solution.