FixPt Matrix Gain
Multiply the input by a constant matrix.
Description
The FixPt Matrix Gain block is a masked S-function that multiplies the input by a constant matrix (referred to as the matrix gain). The block generates its output by multiplying the input by a specified matrix
\(y=Ku\)
where \(K\) is the matrix gain and \(u\) is the input. If the matrix has m rows and n columns, then the input to this block should be a vector of length n. The output is a vector of length m.
Dialog Box Parameters

- Gain matrix value - Specify as a scalar or vector. The parameter is converted from doubles to the specified data type offline using round-to-nearest and saturation.
- Parameter data type - Any data type supported by the Fixed-Point Blockset.
- Parameter scaling - Radix point-only or slope/bias scaling. The gain can be scaled using the constant matrix scaling modes for maximizing precision. These scaling modes are available only for generalized fixed-point data types. Refer to the section below for details.
- Output data type and scaling - Specify the output data type and scaling via the dialog box, or inherit the data type and scaling from the driving block or by back propagation.
- Output data type - Any data type supported by the Fixed-Point Blockset.
- Output scaling - Radix point-only or slope/bias scaling. These scaling modes are available only for generalized fixed-point data types.
- Lock output scaling so autoscaling tool can't change it - If checked, the output scaling is locked. This feature is available only for generalized fixed-point output.
- Round toward - Rounding mode for the fixed-point output.
- Saturate to max or min when overflows occur - If checked, fixed-point overflows saturate. Otherwise, they wrap.
- Override data types(s) with doubles - If checked, the parameter output data type values are overridden with doubles.
- Log minimums and maximums - If checked, minimum and maximum simulation values are logged to the workspace.
Parameter Scaling
If Parameter data type is a generalized fixed-point number such as sfix(16), the Parameter scaling list provides these scaling modes:
- Use Specified Scaling - Uses the slope/bias or radix point-only scaling specified for the editable Parameter scaling parameter (for example, \(2^{-10}\)).
- Use Best Precision: Element-wise - Produces radix points such that the precision is maximized for each element of the Gain matrix value matrix.
- Use Best Precision: Row-wise - Produces a common radix point for each element of a Gain matrix value row based on the best precision for the largest value of that row.
- Use Best Precision: Column-wise - Produces a common radix point for each element of a Gain matrix value column based on the best precision for the largest value of that column.
- Use Best Precision: Matrix-wise - Produces a common radix point for each element of the Gain matrix value matrix based on the best precision for the largest value of the matrix.
Characteristics
| Characteristic | Description |
|---|---|
| Input Port | Any data type supported by the blockset |
| Output Port | Any data type supported by the blockset |
| Direct Feedthrough | Yes |
| Sample Time | Inherited |
| Scalar Expansion | Of one input if the other is a vector |
| States | 0 |
| Vectorized | Yes |