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

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

 Akzeptierte Antwort

Toshinobu Shintai
Toshinobu Shintai am 14 Jun. 2023

1 Stimme

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

1 Kommentar

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu ループと条件付きステートメント finden Sie in Hilfe-Center und File Exchange

Produkte

Tags

Community Treasure Hunt

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

Start Hunting!