This example shows how to create a baseline test by capturing data from a test case with table iterations. You create the iterations from Signal Editor scenarios in the model. Before running the example, navigate to a writable folder on the MATLAB® path.
1. Open the model. At the command line, enter
Model = 'sltestCar'; open_system(Model);
2. Open the Test Manager and create a test file. At the command line, enter
3. In the Test Manager, click Test File from Model from the New dropdown.
4. Specify the test file.
sltestCar as the Model.
Enter the test file name or full path in Location.
Baseline as the Test Type.
5. Select the test case. Expand the test file and select the sltestCar/Inputs test case.
6. Select the signals for the baseline data:
In the Simulation Outputs section, click Add.
In the model canvas, select the
output torque signal and in the Connect dialog, check the box for that signal. Select the
vehicle speed signal and check its box in the dialog.
In the Test Manager message dialog box, click Done.
The signals appear in the Logged Signals table.
7. View iterations for the test case:
Expand the Iterations and Table Iterations sections. The iterations for the selected test case automatically appear. The iterations correspond to the four Signal Editor scenarios.
8. Capture baseline data for the iterations:
In the Baseline Criteria section, click the arrow next to Capture.
Select MAT as the File format.
Specify the location to save the baseline data files in the File field.
Select Capture Baselines for Iterations.
The model simulates for all Signal Editor scenarios. The baseline data for
vehicle_speed are captured in four MAT files. Also, each baseline data set is added to its corresponding iterations in the table.