| DSP Blockset | Search  Help Desk |
| Matrix Scaling | See Also |
Scale the rows or columns of a matrix by a specified vector.
Library
Matrix Functions, in Math FunctionsDescription
The Matrix Scaling block scales the rows or columns of the input matrix A by the input vector D. When the Mode parameter is set to Scale rows, the block multiplies each element of vector D across the corresponding row of matrix A.
This is equivalent to premultiplying A by a diagonal matrix with diagonal D.
y = diag(D)*A % equivalent MATLAB codeWhen the Mode parameter is set to Scale columns, the block multiplies each element of vector D across the corresponding column of matrix A.

This is equivalent to postmultiplying A by a diagonal matrix with diagonal D.
y = A*diag(D) % equivalent MATLAB codeThe length of vector D must be consistent with the intended matrix operation (i.e., D must have the same length as the dimension of A being scaled). The output is the same size as the input matrix A. Note
Dialog Box

See Also
Matrix Multiplication