Contents

sumsqr

Sum of squared elements of matrix or matrices

Syntax

[s,n] = sumsqr(x)

Description

[s,n] = sumsqr(x) takes a matrix or cell array of matrices and returns,

s

Sum of all squared finite values

n

Number of finite values

If x contains no finite values, the sum returned is 0.

Examples

m = sumsqr([1 2;3 4])
[m,n] = sumsqr({[1 2; NaN 4], [4 5; 2 3]})

See Also

| |

Was this topic helpful?