| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink Design Verifier |
| Contents | Index |
| Learn more about Simulink Design Verifier |
Note dv.test, which is similar to sldv.test, will be removed in a future release. Use sldv.test instead. |
sldv.test(expr)
sldv.test(expr) Specifies that expr should be made true when generating tests. Use any valid Boolean Embedded MATLAB expression for expr.
This function has no output and no impact on its parenting function, other than any indirect side effects of evaluating expr. If you issue this function from the MATLAB command line, the function has no effect.
Intersperse sldv.test test objectives within Embedded MATLAB code or separate the objectives into a verification script.
The Test objectives option in the Test generation pane applies to test objectives represented with the sldv.test function, as well as with the Test Objective block.
Add a test objective and test conditions, using Embedded MATLAB expressions.
Open the sldvdemo_cruise_control model and save it as my_sldvdemo_cruise_control.

Remove the Test Condition block for the speed block signal. Instead of the Test Condition block, this example uses sldv.test and sldv.condition.
From the User-Defined Functions library, add an Embedded MATLAB Function block and:
Name the block "tests."
Connect the block to the signal for the speed block and to the signal for the target block.

Add the following code to the tests Embedded MATLAB Function block.

In the Embedded MATLAB editor, save the updated code.
Generate the test: select Tools > Design Verifier > Generate Tests.
Instead of using the sldv.test function, you can insert a Test Objective block in your model.
However, using sldv.test instead of a Test Objective block offers several benefits, described in About Test Case Generation.
Proof Assumption | Proof Objective | sldv.assume | sldv.condition | sldv.prove | Test Condition | Test Objective
![]() | sldvruntest | Block Reference | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |