Using srcWorkspace with Data Dictionaries
3 次查看(过去 30 天)
显示 更早的评论
I'm attempting to upgrade an existing model to use Data Dictionaries. Currently, the code calling the model places external input data into a functions workspace and then executes a sim command using the parameter ('srcWorkspace','caller'). Once I attach to a data dictionary, it appears as though Simulink is ignoring the srcWorkspace setting and only using the base workspace to attempt to find variables.
Was wondering if anybody knows if this is intended behavior with Data dictionaries, or if there is a way to use Data dictionaries and define my input data inside a function. I'm using Matlab R2016b
0 个评论
回答(1 个)
Tamas Rozsa
2022-1-7
I've experienced a very similar incorrect behavior with R2020a Update 7, too.
MathWorks confirmed that this is a bug. 'SrcWorkspace' should work properly with data dictionaries as well.
Another way and a possible workaround to feed the model with temporary data is utilizing Simulink.SimulationInput class (permanent data shall be stored in data dictionaries). Details for R2020a can be found here: https://www.mathworks.com/help/releases/R2020a/simulink/slref/simulink.simulationinput-class.html
According to the tech support, "this workflow is the recommended workflow to apply variable overrides, as the SimulationInput object provides better containerization, traceability, and reuse across workflows".
Unfortunately, this has been introduced only in R2017b, i.e. it was not yet available in R2016b.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Manage Design Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!