フィルターのクリア

Simulink Pass Variable to Mask Parameter

2 ビュー (過去 30 日間)
Nash Gould
Nash Gould 2019 年 3 月 4 日
回答済み: Jared Belke 2019 年 6 月 27 日
Hi, I am using the PV Array block in a program that I'm writing, and I would like to be able to pass a variable into the parameters of the mask. Is there a way to do this?
Thanks!

採用された回答

Jared Belke
Jared Belke 2019 年 6 月 27 日
Say you have some Mask Parameter named "Param", and you would like to pass the value contained by some variable named "Var" into Param. You can do:
set_param(gcb, 'Param', Var);
Note that gcb gets the name of the current block. If you are calling set_param in the callback function for Param, the current block will be the correct block. If you are calling set_param from somewhere other than the callback for Param, you may have to put the explicit blockname instead of gcb. To get this block name, just click on the block, and then run gcb in the matlab command line.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAuthor Block Masks についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by