Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

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

| |

Introduced before R2006a

Was this topic helpful?