Reduce data points from 200 to 108

76 views (last 30 days)
I have a data series with 200 data points and I need to compress this information to 108 data points. I don't think I can use a moving average filter as the window wouldn't be an integer so is there a way in MATLAB to do this?

Accepted Answer

Star Strider
Star Strider on 21 Nov 2019
I have no idea what your data are or what you want to do with them, other than reduce the number of them.
Interpolating them to a shorter independent variable vector may be an option. See if the interp1 function can do what you want. The linspace function can be helpful in providing the new independent variable vector.
Star Strider
Star Strider on 21 Nov 2019
As always, my pleasure!

Sign in to comment.

More Answers (1)

Daniel M
Daniel M on 21 Nov 2019
Edited: Daniel M on 21 Nov 2019
Do you want to:
  1. truncate your signal?
  2. downsample or resample
  3. interpolate
  4. something else?
Truncate example:
t = 1:200;
x = rand(1,200);
x2 = x(1:108);
Daniel M
Daniel M on 21 Nov 2019
That's what resampling function is for. Star Strider has responded under his answer.

Sign in to comment.





Community Treasure Hunt

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

Start Hunting!

Translated by