Update simulink block

16 ビュー (過去 30 日間)
Michael Joslin
Michael Joslin 2012 年 3 月 30 日
I am writing an automation code that replaces certain blocks with a lookup table from a library that my company provides. The block is a 2D lookup table by default but has an option to be changed to a 1D. I run the replace block command and uset set_param() to set the row data, table data and change it to 1D. However after the script is done running the block still has two input ports, but if I open the block I see that all of the axis are set and the 1D option is selected and if I click 'ok' or 'apply' then the block will switch to having only one input port. Is there a way to update the block via script so the users can avoid having to open each block individually and applying the changes?

採用された回答

Andreas Goser
Andreas Goser 2012 年 3 月 30 日
Try "update diragram"
You can update a Simulink model from the MATLAB command window or from a MATLAB file by using the SET_PARAM command. For example, typing:
set_param('sys', 'SimulationCommand', 'update');
at the MATLAB command prompt updates the Simulink model 'sys'
  2 件のコメント
Michael Joslin
Michael Joslin 2012 年 4 月 2 日
This updates the entire block diagram, is it possible to update the parameters of blocks individually?
Andreas Goser
Andreas Goser 2012 年 4 月 4 日
Not that I know. Maybe it is not possible by design. E.g. as some parameters of blocks can only be evaluaterd looking at the whole model.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Model Editing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by