Simulink trying to map struct to run-time parameter

13 vues (au cours des 30 derniers jours)
Marshall Trout
Marshall Trout le 21 Août 2019
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.

Réponse acceptée

Marshall Trout
Marshall Trout le 26 Août 2019
Unsure what the actual cause was, but a windows update seems to have cleared up the error.
  2 commentaires
Toheed Ghandriz
Toheed Ghandriz le 26 Sep 2019
I got the same error but it was solved after removing the check mark in front of 'Tunable' in Edit data dialog box for 'VarName'. My VarName was structure too.
Hong Yang
Hong Yang le 20 Jan 2021
Thank you, Toheed Ghandriz !

Connectez-vous pour commenter.

Plus de réponses (1)

Noah Tang
Noah Tang le 28 Sep 2021
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.

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by