Accessing data dictionary from Simulink model InitFcn callback
Show older comments
I have a Simulink model. I don't want to use variables from the base workspace, since the behavior could then be changed if someone else introduces variables with the same name. So I linked the model to a data dictionary. The problem is, the value of some variables are derived from other variables.
For instance:
in data dictionary: x=2, y = 5
derived parameters: z1 = x + y, z2 = x - y
I implemented the InitFcn callback with assignment for z1 and z2, however the initFcn does not have access to the variables from the data dictionary
Undefined function or variable 'x'. Variable 'x' does not exist.
Is there a way to access the Data Dictionary from a function or a script?
Accepted Answer
More Answers (0)
Categories
Find more on Manage Design Data in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!