How can I use "setVariable" to change the variable of a reference model used in a test harness using scripted iterations in R2024b?
조회 수: 4 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2024년 12월 11일
답변: MathWorks Support Team
2024년 12월 12일
I have a test harness where I am using a reference model. I want to change value of a variable in reference model, which exists both in test harness and in reference model, without changing it in the test harness workspace. I have created a custom class with a method which uses "setVariable" function to achieve this. However, keeping the "Source" in "setVariable" as the full path of the variable, does not work. What is the correct way to achieve this workflow in MATLAB R2024b?
채택된 답변
MathWorks Support Team
2024년 12월 11일
In order to achieve this workflow, the "Source" parameter should be set directly as "RefModelName", instead of "testHarnessName/RefModelName". This will ensure the variable is found in the workspace of the reference model and updated with the value provided with the "setVariable" function.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Event Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!