Calculate variablity over specified interval and apply corresponding calculation back to formula
Show older comments
I'm trying to reproduce a calculation I've seen in a paper called variablity. It's defined as follows:

so Xvariability = sqrt((Xn-Xavg)^2) for 1 to n
Xavg needs to be calculated over a regular interval, in this case, a Y interval of 0.5 with a sensor recording X at irregular intervals of Y.
In the example below, what's the best way to calculate Xavg for 0-0.5, 0.5-1.0, 1.0-1.5 and 1.5-2.0, then apply those Xavg values in the Xvariabilty formula back to each original value of X with corresponding Xavg for the correct interval?
%tables
Y = [0;0.0542;0.0801;0.2222;0.3959;0.4572;0.5110;0.5348;0.5712;0.6099;0.6437;0.6799;0.8011;0.8928;0.9590;1.0110;1.13;1.22;1.31;1.43;1.5;1.61;1.73;1.83;1.91;2.0];
X = [118.7000;207.8000;139.6000;176.0000;177.8000;229.3000;242.4000;138.9000;85.7000;140.8000;164.5000;125.4000;189.8000;164.0000;118.4000;211.4000;148.7000;207.8000;119.6000;116.0000;117.8000;129.3000;242.4000;198.9000;285.7000;130.8000];
YX = [Y,X];
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!