set_paramでブロック変数の変更ができない

set_paramでブロック変数の変更をしようとするとエラーが出てしまいます。
例えばConstantブロックのValueを変えようとすると以下のエラーがでます。
「パラメーター 'Value' に対する Constant block 'Constant' 内の設定が無効です」
解決策をご教示頂けないでしょうか。
宜しくお願い致します。

 Risposta accettata

Toshinobu Shintai
Toshinobu Shintai il 14 Giu 2023

1 voto

例えば、以下のように記述していませんでしょうか。
set_param('Constant', 'Value', 2)
渡せる値は数値ではなく、文字列です。例えばブロックに2を入れたい場合は、
set_param('Constant', 'Value', '2')
と記述します。

1 Commento

基喜
基喜 il 14 Giu 2023
ご回答有難う御座います。
無事解決致しました。

Accedi per commentare.

Più risposte (0)

Prodotti

Tag

Community Treasure Hunt

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

Start Hunting!