Simulink trying to map struct to run-time parameter

16 ビュー (過去 30 日間)
Marshall Trout
Marshall Trout 2019 年 8 月 21 日
コメント済み: Toshiyuki 2025 年 12 月 3 日 10:16
When attempting to run a function inside a Simulink model the simulation always fails due to the following error:
Unable to map parameter 'VarName' in 'FunctionName' to a run-time parameter. This parameter is an unsupported variable class such as a string, structure, cell, or an unsupported data type.
VarName is indeed a struct, but I do not understand why Simulink is attempting to make it a run-time parameter. VarName contains the initial conditions and online parameters used throughout the simulation. The Simulink model was built in 2013a and I am attempting to update it to run in 2017b. How can I prevent this error from occuring?
Thanks in advance.

採用された回答

Marshall Trout
Marshall Trout 2019 年 8 月 26 日
Unsure what the actual cause was, but a windows update seems to have cleared up the error.
  3 件のコメント
Hong Yang
Hong Yang 2021 年 1 月 20 日
Thank you, Toheed Ghandriz !
Toshiyuki
Toshiyuki 2025 年 12 月 3 日 10:16
Thank you, Toheed! Your answer was helpful in resolving the issue.

サインインしてコメントする。

その他の回答 (1 件)

Noah Tang
Noah Tang 2021 年 9 月 28 日
I was able to reproduce the same error message, and the comparison shows that the error happens when one field of my struct variable has an empty array as its value. Otherwise, the parameter passing process works just fine.

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by