How to interpolate in MatLab

Posted by G Sam on Stack Overflow See other posts from Stack Overflow or by G Sam
Published on 2012-12-04T10:03:45Z Indexed on 2012/12/04 11:08 UTC
Read the original article Hit count: 265

Filed under:

I have a 1x1 Matrix of points which specifies speed of a drive with respect to time. This speed changes throughout the operation; which means that the difference between two points is changing.

To give you an example: M = [1; 2; 3; 5; 7; 9; 11; 15; 19]. (Only that this is a 892x1 matrix)

I want to make this matrix twice as long (so changing the relative speed per timestep), while retaining the way the speeds change. Eg: M' = [1; 1.5; 2; 2.5; 3; 4; 5; 6; 7; 8; 9; 10; 11; 13; 15; 17; 19].

Is there an easy way to do this in MatLab?

So far I have tried upsampling (which fills the time step with zeros); interp (which fills it with low-pass interpolation.

Thanks!

© Stack Overflow or respective owner

Related posts about matlab