Smooth bad data in MattLab

2 views (last 30 days)
Connor Burchell
Connor Burchell on 24 Feb 2020
Commented: Alex Mcaulley on 24 Feb 2020
I have some Velocity/Elevation data taken in a flume channel using an ADV probe. The majority of the data is good however, at certain elevations the data is erratic and the mean data plotted shifts quite considerably. (See below for an attached image). I am hoping to smooth this data out and generate a nice curve. Any suggestions?
Star Strider
Star Strider on 24 Feb 2020
The smoothdata function is another option.

Sign in to comment.

Accepted Answer

ME on 24 Feb 2020
I think you could easily do this by using find to locate the indices of all values lying in the shifted range. This would be something like:
idx = find(y>= 80 & y<=100)
but with the limits tweaked appropriately to set the exact range to be adjusted.
You can then use these indices to alter the relevant portion of the x data using something along the lines of:
X(idx) = X(idx) + 0.1
or whatever the appropriate value to shift is.
I'm sure there is much fancier and more automated ways of doing this but as a first approximation this should do a pretty good job.
Alex Mcaulley
Alex Mcaulley on 24 Feb 2020
I'm sorry, it wasn't my intention, your answer just surprised me and sometimes the simplest answer is the most useful

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by