https://au.mathworks.com/help/matlab/ref/matlab.unittest.testcase.addteardown.html
matlab.unittest.TestCase.addTeardown - Dynamically add teardown code to test case - MATLAB
This MATLAB function registers the teardown code teardownFcn with the test case.
to testmatlabunittesttestcase