How can I determine the value experimental data settled on?

I have thrust/RPM data collected from a load cell/hall effect switch (see example below), I want to find the mean value it settles on (around -7.5N in this example) and not accidentally find the initial region (~-5.4). The sample rate and duration of each data set varies and I have over 100 data sets so I'm looking for a way to find this automatically whilst looping through all the files, but I don't know what the best way to go about this is and couldn't find any posts on it, any suggestions will be appreciated.

 Accepted Answer

I don't see the problem. Throw away most of your data. (At least to determine the long term behavior.) Then compute the mean.
Ok. You want to do this automatically, for many curves? So use ischange. Perhaps use the "linear" option. This will break your curve down into approximately linear regimes. You want the LAST regime.
Then take the mean of the entire curve over the last regime that it finds. For example:
t = linspace(0,1000,100);
x_t = 1 + erfc((t - 500)/100) + randn(size(t))/20;
plot(t,x_t,'.')
[TF,S1,S2] = ischange(x_t,'linear');
TF = find(TF)
TF = 1×2
40 61
So it found a pair of change points. It thinks something happened at roughly t=40 and t=61.
mean(x_t(TF(end):end))
ans = 1.0119

More Answers (0)

Community Treasure Hunt

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

Start Hunting!