This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

std2

Standard deviation of matrix elements

Syntax

B = std2(A)

Description

example

B = std2(A) computes the standard deviation of all values in array A.

You optionally can compute the standard deviation using a GPU (requires Parallel Computing Toolbox™). For more information, see Image Processing on a GPU.

Examples

collapse all

Read a grayscale image into the workspace, then calculate the standard deviation of the pixel intensity values.

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

Read a grayscale image into the workspace as a gpuArray object, then calculate the standard deviation of the pixel intensity values using a GPU.

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

Input Arguments

collapse all

Input data, specified as a numeric or logical array.

To perform the computation using a GPU, specify A as a gpuArray that contains a numeric or logical array.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical

Output Arguments

collapse all

Standard deviation of input data, returned as a numeric scalar. If the data type of A is single, then the data type of B is also single. Otherwise, the data type of B is double.

If the standard deviation is computed using a GPU, then B is returned as a gpuArray containing a numeric scalar.

Data Types: single | double

Extended Capabilities

See Also

| | |

Introduced before R2006a