Main Content


Rebuild test harness and update workspace entries and configuration parameter set based on main model


sltest.harness.rebuild(harnessOwner,harnessName) rebuilds the test harness harnessName based on the main model containing harnessOwner. Optionally, the function transfers the active configuration set, but not the inactive sets, of the main model, and workspace entries associated with harnessOwner to the test harness harnessName. The function also rebuilds conversion subsystems in the test harness. If you specified to use existing generated code for a SIL/PIL subsystem using sltest.harness.create or sltest.harness.set, the harness rebuild uses that code instead of regenerating it. Subsystem model test harnesses always rebuild.


collapse all

Change the denominator value of the Stick Prefilter in the main model. Then, rebuild the controller_harness, which is associated with the Controller subsystem in the f14 model. Notice that the parameter is updated in the harness.


set_param('f14/Controller/Stick Prefilter',...
blkpath = 'controller_harness/Controller/Stick Prefilter';
disp(['Original denominator: ' get_param(blkpath,'Denominator')])

disp(['Updated denominator: ' get_param(blkpath,'Denominator')])

Input Arguments

collapse all

Model or component handle, or path, specified as a character vector or double

Example: 1.9500e+03

Example: 'model_name'

Example: 'model_name/Subsystem'

The name of the harness, specified as a character vector.

Example: 'harness_name'

Version History

Introduced in R2015a