Mark the values which are considered as spikes in the data

7 views (last 30 days)
The data is contained within a column vector. I need to find the so called spikes i.e. find their indices so I can later replace those values using linear interpolation. In the question it says: Consider a spike when the difference between consecutive values is larger than 750.
I am assuming I need to write a for loop to iterate through the vector and compare each element with the one before it, but since I am new to Matlab I am not sure how to approach this.
Thank you

Answers (1)

Akira Agata
Akira Agata on 30 Oct 2021
Moved: Sabin on 7 Jan 2023
I believe findpeaks or isoutlier will detect spikes.
To investigate which (or some other) method will work, could you upload a sample data if possible?

Community Treasure Hunt

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

Start Hunting!