Skip to main content

linspace

Function linspace 

Source
pub fn linspace(start: f64, end: f64, n: usize) -> Vec<f64>
Expand description

Returns n evenly spaced values from start to end inclusive.

As in MATLAB, the first value is exactly start and the last is exactly end; one value yields [end] and zero values yield an empty vector.

use ironlab::linspace;

assert_eq!(linspace(0.0, 1.0, 5), vec![0.0, 0.25, 0.5, 0.75, 1.0]);