| 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.condition, which is similar to sldv.condition, will be removed in a future release. Use sldv.condition instead. |
sldv.condition(expr)
sldv.condition(expr) Specifies that expr is true for every time step in a generated text case. 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.condition test conditions within Embedded MATLAB code or separate the conditions into a verification script.
The Test conditions option in the Test generation pane applies to test conditions represented with the sldv.condition function, as well as with the Test Condition 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.condition function, you can insert a Test Condition block in your model. However, using sldv.condition instead of a Test Condition block offers several benefits, described in About Test Case Generation.
You can also specify test conditions by using Embedded MATLAB without using the sldv.condition function. However, using sldv.condition instead of directly using Embedded MATLAB eliminates the need to:
Express the constraints with Simulink blocks
Explicitly connect the condition output to a Simulink block
Proof Assumption | Proof Objective | sldv.assume | sldv.prove | sldv.test | Test Condition | Test Objective
![]() | sldvcompat | sldvextract | ![]() |

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 |