Simulink model instances with data dictionary
2 次查看(过去 30 天)
显示 更早的评论
Good morning, I am developing a project where I have a referenced model. I want to get 2 instances of these models using different values of configuration. For that i have read the documentation of Matlab/Simulink about these option:
In the documentantion there isn´t anything about data dictionaries. My idea is to use Data Dictionaries in my model but having this opportunity.
Is this possible? Has someone do something similar?
if it is not possible I think the best solution is to use modle workspace to get the model in a capsule. What do you think?
Thank you!
0 个评论
回答(1 个)
Harish Vavilla
2019-3-22
Hello Ander,
i understand you want to use multiple instances of the same model but should be able to provide different possible parameters for those instances.
If you have R2019a,
There is a new feature called Instance parameters to do this and the doc link can be found here
If you have an earlier version,
In that case As you have rightly described give a Variable name to the Parameter(lets call it with name P on the block name) in the model but Don't define it in the Model WorkSpace of the that model(lets call it model1).
Now create mode2 with model references to model1 with variable P defined in its Model WorkSpace having the value you want.
Similar to the last step create model3 with model references to model1 with variable P defined in its Model WorkSpace having the value you want.
Now create model 4 that has model reference to model2 and model3. This is your final solution.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!