<< Statistics Statistics mps_stdev >>

mpscilab >> mpscilab > Statistics > mps_mean

mps_mean

Mean of a vector/matrix entries

Calling Sequence

mps_mean( rop, op [, orientation] )
rop = mps_mean( op [, orientation] )

Arguments

rop

multi-precision matrix

op

Multi-precision matrix

Description

Computes the mean value of a matrix's elements.

mps_mean( rop, op [, orientation] )

Computes the mean of all of the elements of op along the specified orientation and returns the result in rop. The orientation is specified as a single character either '*', 'r' and 'c' respectively for row, column and whole matrix.

rop = mps_mean( op [, orientation] )

Creates a multi-precision matrix of the correct size and with the same precision as op containing the result.

Usage notes

The mean value is calculated by using an accurate summation to prevent a possibly important loss of precision.

Examples

// Mean value of a matrix.
A = [1 2; 3 4]
mpsA = mps_init2(A,100)
rop = mps_init(1,1,100)
rop = mps_mean(op)

// Mean value of each rows of a matrix.
A = [1 2; 3 4]
mpsA = mps_init2(A,100)
rop = mps_init(2,1,100)
mps_mean(rop,op,'r')

See Also

<< Statistics Statistics mps_stdev >>