An open API service indexing awesome lists of open source software.

https://github.com/h2non/vetrix.js

Turns a vector into a matrix
https://github.com/h2non/vetrix.js

Last synced: 3 months ago
JSON representation

Turns a vector into a matrix

Awesome Lists containing this project

README

          

# Vetrix.js

> Converts a vector into a matrix

## Install

`$ npm install vetrix`

## Usage

`vetrix(vector, columns)`

## Examples

```JS

var vetrix = require('vetrix');

var a = [1,2,3,4,5,6,7,8,9];
var b = vetrix(a, 3);
// b = [[1,2,3],[4,5,6],[7,8,9]]

```

```JS

var vetrix = require('vetrix');

var a = [1,2,3,4,5];
var b = vetrix(a, 2);
// b = [[1,2],[3,4],[5]]

```