please help me I want to import data to wok space and export data from work space during simulation in the same model ?
显示 更早的评论
In my model I want to collect A set of numbers (which is variable by changing the switch ) I want to equal the output of summation to variable (N) where I want this variable in another block like gain the problem in work space is save date after simulation end I want to read N during simulation (where N is variable) The figure of model is attached below How can I do it??
回答(1 个)
A Jenkins
2015-2-2
0 个投票

5 个评论
MAB
2015-2-3
MAB
2015-2-3
A Jenkins
2015-2-3
If you can write your conditions for N as MATLAB code, then you can guarantee it runs first by putting it in the model initialization.

MAB
2015-2-3
A Jenkins
2015-2-5
Simulink is not intended to be used that way, which is why I am proposing solutions slightly different than what you are asking.
The proper solution is to make modifications to your blocks such that "N" is a signal and not a parameter.
To learn why, and potential "hacks" (with their own drawbacks) such as using set_param(), see this article.
类别
在 帮助中心 和 File Exchange 中查找有关 Modeling 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!