mean_matrix — Returns the elementwise mean of a matrix.
The operator mean_matrix returns the mean values of the elements of the Matrix defined by the matrix handle MatrixID. A new matrix MatrixMean is generated with the result and the matrix handle MatrixMeanID of this matrix is returned. Access to the elements of the matrix is possible e.g. with the operator get_full_matrix.
The type of mean determination of the matrix can be selected via the parameter MeanType:
The mean is returned for each column of the Matrix separately. The resulting matrix MatrixMean has one row and the identical number of columns as the input matrix.
/ 8.0 4.0 -3.0 \ Matrix = \ -6.0 2.0 7.0 / MeanType = 'columns' -> MatrixMean = [ 1.0 3.0 2.0 ]
The mean is returned for each row of the Matrix separately. The resulting matrix MatrixMean has the identical number of rows as the input matrix and one column.
/ 8.0 4.0 -3.0 \ Matrix = \ -6.0 2.0 7.0 / MeanType = 'rows' / 3.0 \ -> MatrixMean = \ 1.0 /
The mean is returned using all elements of the Matrix. The resulting matrix MatrixMean has one row and one column.
/ 8.0 4.0 -3.0 \ Matrix = \ -6.0 2.0 7.0 / MeanType = 'full' -> MatrixMean = [ 2.0 ]
Matrix handle of the input matrix.
Type of mean determination.
Default value: 'columns'
List of values: 'columns', 'rows', 'full'
Matrix handle with the mean values of the input matrix.
If the parameters are valid, the operator mean_matrix returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.