Documentation Center

  • Trial Software
  • Product Updates

std2

Standard deviation of matrix elements

Syntax

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

Description

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.

Examples

Calculate the standard deviation.

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

   31.6897

Calculate the standard deviation on a GPU.

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

More About

expand all

Algorithms

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

See Also

| | | |

Was this topic helpful?