Main Content

Compute the Standard Deviation

Compute the standard deviation of a 3-by-2 matrix input, dsp_examples_u, using the Standard Deviation block.

Open and run the model.

The block processes the input as a two-channel signal with a frame size of three and computes the standard deviation along each column.

model = 'ex_standarddeviation_ref';
open_system(model)
sim(model)

Display the input and the standard deviation output values.

disp('Data Input')
disp(dsp_examples_u)
disp('Standard Deviation Values')
disp(std_val)
Data Input
     6     1
     1     3
     3     9
    -7     2
     2     4
     5     1
     8     6
     0     2
    -1     5
    -3     0
     2     4
     1    17

Standard Deviation Values
    2.5166    4.1633
    6.2450    1.5275
    4.9329    2.0817
    2.6458    8.8882
         0         0
         0         0

To compute the standard deviation over each row, entire input, or a specified dimension, set the Find the standard deviation value over parameter appropriately.

Close the model.

close_system(model)

See Also

Blocks

Related Topics