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 中查找有关 Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

