Simulink and Variable Sized Global Variables
2 次查看(过去 30 天)
显示 更早的评论
I have a M-Function which reads some data at each time step, stores it in a growing dictionary (A = [A; a], where 'a' is the new data) and then uses it to produce an output.
I would like to use this function in Simulink, however I cannot see a way to create a variable sized global variable that A needs to be.
Could someone please point me in the correct direction?
0 个评论
采纳的回答
C.J. Harris
2012-1-9
I don't believe you can do this, at least not in an easy way. You might be better off looking into the possiblity of initialising A to its maximum size, and then selecting the part of the vector you need to use at each timestep.
0 个评论
更多回答(1 个)
Guy Rouleau
2012-1-10
Simulink supports variable size signals. However you need to specify a maximum size.
This topic is covered here:
If you want, you can use variable size also in the MATLAB Function block:
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Naming Conventions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!