Mux
Signal RoutingThe Mux (Multiplexer) block combines multiple scalar input signals into a single multi-dimensional vector signal. It is widely used in control diagrams to bundle independent scalar measurement channels before feeding them into vector-valued blocks—such as StateSpace models, MIMO controllers, Kalman filters, and multi-channel scopes. The block provides a configurable number of input ports (from 2 up to 10) and introduces zero numerical distortion or computational delay into the signal path.
Mathematical Model
The block takes incoming real-valued scalar signals , where , and concatenates them into an ordered -dimensional column vector :
If an individual input port is left unconnected, its corresponding vector element is assigned the default floating-point value of zero:
Inputs & Outputs
| Direction | ID | Label | Type | Status |
|---|---|---|---|---|
| → In | in |
In | number | Required |
| ← Out | out |
Vector | vector | Output |
Parameters
| Parameters | Label | Type | Default | Description |
|---|---|---|---|---|
numInputs |
Number of Inputs | number | 2 |
Usage Examples
Example 1: Consolidating Triaxial Accelerometer Signals for State-Space Plants
In an inertial navigation simulation, three independent scalar accelerometer sensors measure specific forces along orthogonal body axes (, , ). Routing these three signals into a Mux block with numInputs = 3 produces a clean vector signal that directly feeds the input port of a 3D StateSpace navigation kinematic model.
Example 2: Bundling Multi-Channel Telemetry for Vector Display
Collecting temperature, pressure, and motor current from separate physical plant subsystems. A Mux block configured with numInputs = 3 bundles the signals into a single compound connection, which routes cleanly into a multi-channel uPlotDisplay scope without cluttering the diagram canvas with parallel wire crossings.
Remarks & Best Practices
- Vector Concatenation vs. Summation: The Mux block performs purely geometric vector assembly . It does not sum or add input values; to compute the arithmetic sum of multiple signals, use the
Sumblock. - Scalar-Only Inputs: All connected input lines must be scalar numbers. Feeding vector signals into individual input ports of a Mux block is not supported; use multiple Mux stages or dedicated bus routing.
- Unconnected Input Handling: Any unconnected input port defaults safely to , preventing null pointer exceptions during simulation execution.
- Zero Computation Latency: Implemented as a direct in-memory array concatenation in WebAssembly with zero transport delay or phase lag.
Related Components
- Demux: Separates a vector signal back into individual scalar signals.
- Sum: Computes the algebraic sum of multiple input signals.
- StateSpace: Continuous multi-input multi-output dynamic system.
- uPlotDisplay: Multi-channel waveform oscilloscope.