From Workspace block using Data Dictionary
显示 更早的评论
How can I use a timeseries as a simulation input in a Simulink subsystem or model reference, when the model uses a Data Dictionary?
I tried using a 'From Workspace' block, which I think should be possible, since the documentation for the block has a section on Use with Data Dictionary. Here's what it says:
To access simulation input data, store the target variable in the base workspace and set the Data parameter by using a call to the evalin function. In the call to evalin, specify the ws argument as 'base' so that the block seeks the variable in the base workspace instead of the data dictionary. For example, if the name of the variable is myTimeseriesObject, set Data to evalin('base','myTimeseriesObject').
But, right after adding a 'From Workspace' block to my model a get a popup error message saying this:
This model cannot contain From Workspace block 'MyModelName/Input_Processing/From Workspace' because the model is linked to a data dictionary. For a test harness model, configure it to use the base workspace instead of a data dictionary. Otherwise, replace this block with a root Inport or other source block.
Thank you.
采纳的回答
更多回答(2 个)
Arunkumar M
2018-11-9
0 个投票
Even when model is linked to data dictionary, you can use evalin function to access variables which are defined in base workspace - refer attached image

-Other method is to create a referenced subsystem and pointing to the model which is linked to data dictionary and the reference subsystem can be linked to base workspace. Then the input from base workspace shall be propagated to the model linked to data dictionary
Thomas Kotwal
2018-11-9
0 个投票
2 个评论
Arunkumar M
2018-11-10
No They are constant blocks? Do you specifically want to use From Workspace blocks?
Thomas Kotwal
2018-11-12
类别
在 帮助中心 和 File Exchange 中查找有关 Interactive Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!