Let's say I have a data table that is 1x15
[21 78 33 59 90 26 88 54 36 63 72 37 48 93 56]
So for my streaking equation I need to implement this:
% Streaking = {[abs(Q_n - ((Q_n-1 + Q_n+1)/2))] / ((Q_n-1 + Q_n+1)/2)))}*100
Explanation of the Equation:
Let's assign the value 90 to Q_n (this comes from cell (1,5)) Using this value would mean that for Q_n-1 we'd want the value 59 and for Q_n+1 we'd want the value 26 (so in essence the cell before (1,4) and the cell after (1,6))
Q_n = 90
Q_n-1 = 59
Q_n+1 = 26
My question is: How would I do this for the entire data set and apply them to the streaking equation? (excluding row 1 and 15 as you cant have a Q_n-1 for row 1 and you cant have a Q_n+1 for row 15)
I was thinking of something maybe along the lines of this:
Q_n = 1;
while Q_n < length(middle.middle_interpolate)
Q_n = Q_n+1;
before = middle.middle_interpolate{Q_n-1};
actual = middle.middle_interpolate{Q_n};
after = middle.middle_interpolate{Q_n+1};
averg = ((before + after)/2);
equation = (abs(actual-averg)/averg)*100;
plot(equation);
end