How to interpolate in MatLab
- by G Sam
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!