Filter löschen
Filter löschen

caluculating standard deviation for a vector

4 Ansichten (letzte 30 Tage)
mahesh bvm
mahesh bvm am 16 Apr. 2013
Hi all,
I have a vector of 20 by 1000 and wanted to calculate standard deviation for this vector in the below specified manner
a) Initially I need to calculate standard deviation for every 20 points beginning from 20 to 1000 for every row.
b) This should give around 50 standard deviations for each row. This needs to be computed for all the 20 rows.
b) Later I need to add all 50 standard deviations of every row, which should deliver one final value for each row. So for 20 rows, there would be 20 such finally summed standard deviations.
Kindly help, I really appreciate the help. Thank you.
  1 Kommentar
Jan
Jan am 16 Apr. 2013
"Around 50" values? Wouldn't it be easy to find out, how many values you get?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jan
Jan am 16 Apr. 2013
I guess, you want the deviation in blocks of size 20 from column 21 (not 20!) to 1000?
x = rand(20, 1000);
y = reshape(x, 20, 20, 50);
% Or perhaps you want to omit the first 20 columns:
% y = reshape(x(:, 21:1000), 20, 20, 49);
ys = std(y, 0, 2); % Std over 2nd dimension
r = sum(ys(:));

Kategorien

Mehr zu Spline Postprocessing finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by