How to use parameters from data dictionary in sinmulink's callback function?
显示 更早的评论
i have a simulink model , and Desing data defined in Data Dictionary. now i want to initialize a variable by parameters from data dictionary in initFcn function. but it doesn't work:
Undefined function or variable 'x'. Variable 'x' does not exist.
what should i do?
回答(1 个)
Fangjun Jiang
2022-10-13
0 个投票
Use API to open the data dictionary and get the value, or the easiest thing to do is
2 个评论
Joe
2022-10-13
Fangjun Jiang
2022-10-13
Did you try Simulink.data.evalinGlobal()? There is also Simulink.data.assigninGlobal()
类别
在 帮助中心 和 File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!