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.

std2

Standard deviation of matrix elements

Syntax

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

Description

example

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™.

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.

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

Input image when run on a GPU, specified as a gpuArray.

Output Arguments

collapse all

Standard deviation, returned as a numeric scalar. If the datatype of input A is single, the standard deviation B is returned as a single. Otherwise, B is returned as a double.

Standard deviation when run on a GPU, returned as a gpuArray.

See Also

| | | |

Introduced before R2006a

Was this topic helpful?