scijs/ndarray-linspace

Name: ndarray-linspace

Owner: scijs

Description: Fill an ndarray with equally spaced values

Created: 2016-01-03 23:35:34.0

Updated: 2017-08-10 22:19:28.0

Pushed: 2017-11-20 17:16:03.0

Homepage: null

Size: 12

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ndarray-linspace Build Status npm version js-standard-style

Fill an ndarray with equally spaced values

Example
ndarray = require('ndarray');
linspace = require('ndarray-linspace');

pace(ndarray([], [5]), 2, 3);
> ndarray([2, 2.25, 2.5, 2.75, 3])

pace(ndarray([], [5]), 2, 3, {endpoint: false});
> ndarray([2, 2.2, 2.4, 2.6, 2.8])

pace(ndarray([], [2, 2]), 0, 1);
 => [ 0, 0 ]
    [ 1, 1 ]

pace(ndarray([], [2, 2]), 0, 1, {axis: 1});
 => [ 0, 1 ]
    [ 0, 1 ]
Installation
install ndarray-linspace
API
require('ndarray-linspace')(output, start, end[, options])

An array of equally spaced values.

Arguments:

Returns: A reference to the output

License

© 2015 Ricky Reusser. MIT License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.