mmean()

Read(1965) Label: matrix, multidimensional matrix, mean,

Description:

Calculate the mean value within a matrix or a multidimensional matrix.

Syntax:

mmean(A, n)

Note:

An external library function (See External Library Guide) where parameter n is the ordinal number of level on which the summarization is performed. If n is absent, the desired dimension is the first one whose size is not 1 in matrix A.

Parameter:

A

A matrix or a multidimensional matrix

n

A positive integer

Option:

@a

Calculate the mean on all elements of matrix A and parameter n is invalid

Return value:

A sequence or a number

Example:

 

A

 

1

[[11,12,13],[21,22,23],[31,32,33]]

2

=mmean(A1,1)

Calculate mean value on the matrix’s first level – that is, calculate mean on members of each column.

3

=mmean(A1, 2)

Calculate mean value on the matrix’s second level – that is, calculate mean on members of each row.

4

=mmean(A1)

Calculate mean value on the first level since parameter n is absent.

5

=mmean@a(A1)

Calculate mean value on all elements of the matrix.

6

[[[111,112,113],[121,122,123],[131,132,133]],[[211,212,213],[221,222,223],[231,232,233]]]

Define a three-dimension matrix whose two members are 3*3 matrices.

7

=mmean(A6, 1)

Calculate mean value on matrix A6’s first level, that is, perform the calculation on both of its two member matrices in alignment.

8

=mmean(A6, 2)

Calculate mean value on matrix A6’s second level, that is, perform the calculation on each column of each member matrix.