Bite-sized MBD tips

Let me tell you all the ways…

The use of enumerated data types is often overlooked in the MATLAB / Simulink environment. Using enumerations offers two distinct advantages:

  1. Clarity: the enumeration name tells you what it is
  2. Boundary: When you use enumerations you can’t go outside the allowed set

For Ox only

The MUX block has been part of the Simulink pallet since the beginning. However, for signal combinations either use Vectors (same data types) or Buses (mixed data types).

A “Mux” Ox

Switch to…

The switch block is a useful block for routing basic signals. However it can result in unnecessary calculations being performed and when working with complex upstream calculations, it can decrease the readability of the model.

If the switch logic depends on past values, this can also be an indication that a State Chart would be a better option.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.