Standard deviation of matrix elements


B = std2(A)
gpuarrayB = std2(gpuarrayA)


B = std2(A) returns the scalar B, the standard deviation of the values in A.

gpuarrayB = std2(gpuarrayA) performs the operation on a GPU. The input image is a gpuArray image. The output is a gpuArray scalar. This syntax requires the Parallel Computing Toolbox™.

Class Support

A can be numeric or logical. B is a scalar of class double.

gpuarrayA is a numeric or logical gpuArray. gpuarrayB is a scalar double gpuArray.


Calculate the standard deviation.

I = imread('liftingbody.png');
val = std2(I);
val =


Calculate the standard deviation on a GPU.

I = gpuArray(imread('liftingbody.png'));
val = std2(I)

More About

expand all


std2 computes the standard deviation of the array A using std(A(:)).

See Also

| | | |

Was this topic helpful?