Multi-Port Switch (Simulink Reference)
Có thể bạn quan tâm
| Simulink Reference | ![]() |
Choose between multiple block inputs
Library
Simulink Signal Routing and Fixed-Point Blockset Select
Description
The Multi-Port Switch block chooses between a number of inputs. The first (top) input is called the control input, while the rest of the inputs are called data inputs. The value of the control input determines which data input is passed through to the output port.
If the control input is an integer value, then the specified data input is passed through to the output. For example, suppose the Use zero-based indexing parameter is not selected. If the control input is 1, then the first data input is passed through to the output. If the control input is 2, then the second data input is passed through to the output, and so on. If the control input is not an integer value, the block first truncates the value to an integer by rounding to floor. If the truncated control input is less than 1 or greater than the number of input ports, an out-of-bounds error is returned.
You specify the number of data inputs with the Number of input ports parameter. The data inputs can be scalar or vector. The block output is determined by these rules:
- If you specify only one data input and that input is a vector, the block behaves as an "index selector," and not as a multi-port switch. The block output is the vector element that corresponds to the value of the control input.
- If you specify more than one data input, the block behaves like a multi-port switch. The block output is the data input that corresponds to the value of the control input. If at least one of the data inputs is a vector, the block output is a vector. Any scalar inputs are expanded to vectors.
- If the inputs are scalar, the output is a scalar.
When the Show additional parameters check box is selected, some of the parameters that become visible are common to many blocks. For a detailed description of these parameters, refer to Block Parameters in the Fixed-Point Blockset documentation.
The Index Vector block, also in the Fixed-Point Blockset Select library, is another implementation of the Multi-Port Switch block that has different default parameter settings.
Data type support
The control input of a Multi-Port Switch block can be a real-valued signal of any data type, including fixed-point data types, except int64 and uint64. The data inputs can be of any complexity and data type, including fixed-point data types, except int64 and uint64.
Parameters and Dialog Box


Characteristics
| Dimensionalized | Yes |
| Direct Feedthrough | Yes |
| Sample Time | Inherited from driving blocks |
| Scalar Expansion | Yes |
| Zero Crossing | No |
| Model Info | Mux | ![]() |
Từ khóa » How To Use Switch Block In Simulink
-
Switch Between Two Inputs - Simulink - MathWorks
-
Combine Multiple Signals Into Single Signal - Simulink - MathWorks
-
How To Use Switch Block In MATLAB/ Simulink Step By Step - YouTube
-
Switch Block - Simulink Tutorial - YouTube
-
Switch (Using Simulink)
-
Switch (Simulink Reference)
-
Switch
-
Extras: Simulink Basics Tutorial - Block Libraries
-
Use Switch Block For 3 Different Values With Matlab Simulink
-
How To Use Conditional Statements In Simulink : Tutorial 6
-
Use Switch Block For 3 Different Values With Matlab ... - ADocLib
-
MATLAB Block Model Of The 3 Phase Ideal Switch Located At The ...
-
Simulink - Switch With Two Thresholds/conditions? : R/matlab - Reddit
