how do I read the value of the inputs of a block during runtime?
1 回表示 (過去 30 日間)
古いコメントを表示
I have a simulink model and I want to read the value of one of the inputs of a subsystem of the main model. I paused during runtime and wrote the following command but it gave error. How do I read the input value?
rto = get_param(gcb, 'Faulty Actuators') gives an error saying : SubSystem block does not have a parameter named 'Faulty Actuators', but the name of the input is Faulty Actuator.
0 件のコメント
採用された回答
ES
2014 年 1 月 15 日
gcb is the current block. So if you need a Value of the Propert 'PropertyName', of the current block, you should do
rto = get_param(gcb, 'PropertyName');
You should have selected the inport block so that gcb points that block. In other words, make that inport as the current block by clicking on it.
If you do not want to click on the block, but know the blocks name, then you can do
rto = get_param(BlockPath, 'PropertyName');
And to know the all the properties of the current block, click on the block(set it as current block), then in command window, type
get(gcbh)
gcbh is the handle of the current block, get(gcbh) will list all the properties and values of the current block.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Simulink Functions についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!