Skip to content
Chris Petersen edited this page Oct 16, 2014 · 1 revision

list-resample resamples a list by linear interpolation.

Parameter Description
lst List to be resampled
n Length of desired list

Example

Example 1: Resample list, by interpolating every other value.

> (list-resample '(0 2 4 6 8 10) 11)
(0 1. 2 3.0000000000000004 4 5. 6 7. 7.999999999999999 9. 9.999999999999998)
> (list-resample '(0 10) 5)           
(0 2.5 5. 7.5 10)
> (list-resample '(0 3 10) 7)
(0 1. 2. 3 5.333333333333333 7.666666666666666 9.999999999999998)
Clone this wiki locally