Main Content

Zero-Based Indexing for Multiport Switch Data Ports

The sf_aircontrol model uses a Multiport Switch block in the Physical Plant subsystem. This block uses zero-based indexing for contiguous ordering of three data ports.

The indices are visible on the data port labels. You do not have to open the block dialog box to determine if the data ports use zero-based or one-based indexing.

When you set Data port for default case to Last data port, the last data port includes a * on the label (in this case, the label is *,2). The comma after the * indicates that the data port index has a value. This port corresponds to the default case, which applies when the control input does not match the data port indices. In this example, the Multiport Switch block outputs a value of -0.1 when the control input does not match the data port indices of 0, 1, or 2.