Simulink trying to map struct to run-time parameter
조회 수: 14 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
Marshall Trout
2019년 8월 26일
댓글 수: 2
Toheed Ghandriz
2019년 9월 26일
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.
추가 답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Configure and View Diagnostics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!