Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this 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?