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

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

 Accepted Answer

Toshinobu Shintai
Toshinobu Shintai on 14 Jun 2023

1 vote

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

1 Comment

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

Sign in to comment.

More Answers (0)

Categories

Find more on ループと条件付きステートメント in Help Center and File Exchange

Products

Tags

Asked:

on 14 Jun 2023

Commented:

on 14 Jun 2023

Community Treasure Hunt

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

Start Hunting!