Write and Read Variable into Simulink Model via Matlab or other

조회 수: 4 (최근 30일)
Cyril2022
Cyril2022 2022년 11월 30일
답변: Anshuman 2023년 3월 21일
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.

답변 (1개)

Anshuman
Anshuman 2023년 3월 21일
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!

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by