Why is the method rto.InputPort(1).Data wrong?
이전 댓글 표시
Hi.
I am trying to get the value of Display block by m scripts. I am using the following scripts learned from Access Block Data During Simulation.
obj2=get_param([model_name,'/EngineRPM'],'RuntimeObject');
obj2.InputPort(1).dataasdouble
This method can return correct answer indeed, but sometimes the result is not correct:

Why? And what should I do?
Thanks for your attention.
답변 (1개)
yang xiang
2019년 3월 26일
0 개 추천
댓글 수: 3
Walter Roberson
2019년 3월 26일
편집: Walter Roberson
2019년 3월 26일
That would suggest to me that the block name is possibly not 'd3' . For example it might be 'd3 '
Or perhaps there is something else in the model that has a 'd3' ?
yang xiang
2019년 3월 26일
yang xiang
2019년 3월 26일
카테고리
도움말 센터 및 File Exchange에서 Interactive Model Editing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

