Main Content

Capture Baseline Data from Iterations

This example shows how to create a baseline test by capturing data from a test case with table iterations. The model sf_car contains a Signal Editor that you can use to create iterations.

1. Open the model and clear OpenAtSimulationStart property for scopes.

model = "sf_car";

scopeConfig1 = get_param(model+"/Scope1","ScopeConfiguration");
scopeConfig1.OpenAtSimulationStart = false;
scopeConfig2 = get_param(model+"/Scope2","ScopeConfiguration");
scopeConfig2.OpenAtSimulationStart = false;

Example model sf_car.

2. Open the Test Manager.


3. In the Test Manager, click Test File from Model from the New dropdown.

4. Specify the test file.

  1. Enter sf_car as the Model.

  2. Enter a test filename or full path in Location.

  3. Select Baseline as the Test Type.

5. Select the test case by expanding the test file and selecting the sf_car/Inputs test case.

6. Select the signals for the baseline data:

  1. In the Simulation Outputs section, click Add.

  2. In the model canvas, select the output torque signal and in the Connect dialog, check the box for that signal.

  3. Repeat the previous step for the vehicle speed signal.

  4. In the Test Manager message dialog box, click Done. The signals appear in the Logged Signals table.

7. To view the 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.

  1. In the Baseline Criteria section, click the arrow next to Capture.

  2. Select MAT as the File format.

  3. Specify the location to save the baseline data files in the File field.

  4. Select Capture Baselines for Iterations.

  5. Click Capture.

The model simulates for all Signal Editor scenarios. The baseline data for output_torque and vehicle_speed are captured in four MAT files. Also, each baseline data set is added to its corresponding iterations in the table. Note that iteration settings take precedence over test case settings. In this example, since the baseline data sets are associated with iterations, all of the baseline files are used when the iterations run, regardless of the selections in the Baseline Criteria section of the test case.


Related Topics