How to calculate each consecutive 2data standard deviation

2 Ansichten (letzte 30 Tage)
Mekala balaji
Mekala balaji am 19 Nov. 2017
Kommentiert: Walter Roberson am 19 Nov. 2017
Hi,
I have the below data:
0.12 0.235 0.362
0.125 0.254 0.362
0.131 0.254 0.356
0.235 0.254 0.563
0.326 0.258 0.635
0.362 0.562 0.635
0.362 0.562 0.635
0.523 0.568 0.725
0.555 0.598 0.789
0.555 0.598 0.568
0.555 0.598 0.568
0.555 0.598 0.568
0.555 0.598 0.568
0.555 0.598 0.568
0.555 0.598 0.568
0.555 0.598 0.568
Want to calcaulate STD of each two consecutive data by column.
Kindly help someone, many thanks in advance,

Antworten (1)

Walter Roberson
Walter Roberson am 19 Nov. 2017
reshape( std(reshape(YourData, 2, size(YourData,1)/2, size(YourData,2))), [], size(YourData,2))
or
abs(YourData(1:2:end,:) - YourData(2:2:end,:))/sqrt(2)
The second of these works because the standard deviation between exactly two values X and Y is abs(X-Y)/sqrt(2)
  2 Kommentare
Mekala balaji
Mekala balaji am 19 Nov. 2017
Thanks Sir, But I just wonder will it work for the odd data size(size is 21, not divisible by 2)
Walter Roberson
Walter Roberson am 19 Nov. 2017
You have not defined the result that you want for the isolated row.

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by