How to create a test harness without doing a model compilation in R2020a?

How to create a test harness without doing a model compilation in R2020a?

 Accepted Answer

You can do this easily with the toolbox Simulink Test.
There you can create a test harness while not compiling the model, as you can see below:
For more information on this process, you can access the release-specific documentation for MATLAB R2020a by running the following command in the MATLAB command window:
>> web(fullfile(docroot, 'sltest/ug/select-test-harness-properties-for-your-task.html'))
"Create without compiling the model
Creating a test harness without compiling the model can be useful if you are prototyping a design that cannot yet compile. When you create a test harness without compiling the main model:
  • Parameters are not copied to the test harness workspace.
  • The main model configuration is not copied to the test harness.
  • The test harness does not contain conversion subsystems.
You may need to add blocks such as signal conversion blocks to the test harness. You can rebuild the harness when you are ready to compile the main model. To learn more, you can view the release-specific documentation by running the following command in the MATLAB R2020a command window:
>> web(fullfile(docroot, 'sltest/ug/sync-between-harness-and-model.html'))
Test harnesses for Subsystem models are created without compiling the model."
If you want to do this programmatically, you can use the command:
>> sltest.harness.create
For documentation on this command, please run the following command in the MATLAB R2020a command window to access the release-specific documentation:
>> web(fullfile(docroot, 'sltest/ref/sltest.harness.create.html'))
Using this command, you can set the following option:
'CreateWithoutCompile'
to 'true' or 'false'.
Please follow the below link to search for the required information regarding the current release:

More Answers (0)

Products

Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!