Signal dimensions of a bus in Simulink

19 次查看(过去 30 天)
In Simulink (the new editor, 2012b), I have some nested buses containing only (arrays of) doubles and buses (which in turn only contain doubles). Actually, I have a lot of them. Now when I check Display|Signals&Ports|Signal Dimensions, and do Update, I get, for each bus the size. The strange thing however is that it is shown inconsistently: sometimes I only see a number, such as 6, sometimes I see a number followed by a number in braces, such as 6 {6}, or 57 {84}.
I found out that, in the latter case, the first number is the number of elements in the bus (sum of all sub-elements in case of nested bus), and the second is the number of doubles (they differ if any of the elements is an array).
My question is: why do I sometimes only see a number, and sometimes number plus number in braces?
Gijs van Oort
  2 个评论
Ryan G
Ryan G 2013-1-9
Are you doing anything at all between updating your model?
Gijs van Oort
Gijs van Oort 2013-1-9
No. The question is about two different buses in one model that behave differently (one has only a number, the other one a number plus braced number). Simulink's behaviour is consistent in the sense that, when I compile/update the same model multiple times, the buses behave identically each time. If I modify the model, the behaviour does change, clearly as a result of the modification (not as a result of coincidence).
I have the feeling that the difference in display does reflect a difference in way the bus is treated internally, but I don't have any idea in what sense (as far as I can find out, it is not a matter of virtual/nonvirtual buses. It could have something to do with implicit conversion of the bus to an array, but I cannot imagine that Simulink would allow that, and I don't want that to happen either).

请先登录,再进行评论。

回答(1 个)

Guy Rouleau
Guy Rouleau 2013-1-9
I think your understanding is correct.
To verify that, go to the model configuration -> Diagnostics -> Connectivity
You will find 3 diagnostics controlling if Simulink can treat vectors as buses and vice-versa.
I introduce this and provide some background on why Simulink behaves this way here:

类别

Help CenterFile Exchange 中查找有关 Event Functions 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by