How to replace "extreme" elements of a vector with the meadian value of the next "n" non-extreme elements and how to compute the median vector of a sinusoidal vector.

1 vue (au cours des 30 derniers jours)
Hello, guys!
I am trying to work on some experimental data and I would need your help. I have a vector with my results and it is clear that the beginning and the end of the vector are completely out of the landscape. I would like to replace the extreme values of the vector from the beginning and the end with the median value of next "n" elements that are not extreme (I would define extreme as more than 10% difference from the next values). After that, I would like to convert that sinusoidal vector to a smooth vector (I tried to draw a red line through the middle of the vector).
I have attached a picture with the results. I am looking forward to your answers!
Thank you very much!

Réponses (1)

Jack Sparrow
Jack Sparrow le 25 Nov 2015
Hello, again!
I took advantage of the fact that at the beginning and at the end of the vector the data doesn't fluctuate too much, so I split the vector and ran the following code:
Beginning=FV(1:3000); fBeginning=f(1:3000); out=abs(Beginning-median(Beginning))>1.2*std(Beginning); Beginning(out)=trimmean(Beginning,20);
Ending=FV(26216-3000:26216);
fEnding=f(26216-3000:26216);
out=abs(Ending-median(Ending))>1.2*std(Ending);
Ending(out)=trimmean(Ending,20);
And then reformed the vector. I would liek to know if I can interpolate the "out" values from the "non-out" values instead of using the "treammean".
The question about getting the middle curve through the sinusoidal data stil stays on!
Thank you!

Catégories

En savoir plus sur Argument Definitions dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by