Write and Read Variable into Simulink Model via Matlab or other

4 visualizaciones (últimos 30 días)
Cyril2022
Cyril2022 el 30 de Nov. de 2022
Respondida: Anshuman el 21 de Mzo. de 2023
Hi i would like to change value of variable in input and read the output of this model.
The main target is to write a scenari to validate all the logic of the model with a simple execution and generate a report with PASSED/FAILED status if all steps have been done correctly.
Thanks for your help.

Respuestas (1)

Anshuman
Anshuman el 21 de Mzo. de 2023
Hi Cyril,
To change the value of variable in input:
Open the Model Explorer. On the Modeling tab, click Model Explorer. In the Model Explorer Model Hierarchy pane, select the model workspace. In the Contents pane, select the variable. In the Contents pane or in Dialog pane, edit the value displayed.
To read the output, as soon as the simulation completes, an output variable is generated in the MATLAB workspace, which you can load and read the outputs.
For validating the logic and generating the report , you can use Design verifier app. It gives you some test cases and generates a coverage report, which displays the status of PASSED/FAILED of the objectives in those test cases.
To use Design verifier, go to APPS section in simulink strip, select the mode as Test Generation and Click on Generate Tests.
Hope this helps!

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by