Clear Filters
Clear Filters

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

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

Accepted Answer

Toshinobu Shintai
Toshinobu Shintai on 14 Jun 2023
例えば、以下のように記述していませんでしょうか。
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

Tags

Products

Community Treasure Hunt

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

Start Hunting!