Write and Read Variable into Simulink Model via Matlab or other
4 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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.
For more info visit https://www.mathworks.com/help/sldv/index.html?searchHighlight=design%20verifier&s_tid=srchtitle_design%2520verifier_1
Hope this helps!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!