mikera / core.matrix

core.matrix : Multi-dimensional array programming API for Clojure
Other
700 stars 113 forks source link

equivalent of numpy.linspace #330

Open shark8me opened 6 years ago

shark8me commented 6 years ago

Hi,

Does core.matrix have an equivalent of the numpy.linspace function, which creates a sequence of N evenly spaced points between start and end? A function of the same name also exists in Matlab.

Thanks!

mikera commented 6 years ago

Sounds useful, though not sure if it deserves a first class protocol function in core.matrix.

(m/array (range start end step)) gets you most of the way there..... just needs a but of wrapping to handle the different parameter options and edge cases I think.