| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Return a one-dimensional ndarray formed by concatenating provided input arguments.
var concat1d = require( '@stdlib/ndarray/concat1d' );Returns a one-dimensional ndarray formed by concatenating provided input arguments.
var array = require( '@stdlib/ndarray/array' );
var x = array( [ -1.0, 2.0, 3.0, 4.0 ] );
var y = array( [ -5.0, 6.0, -7.0, -8.0, 9.0, -10.0 ] );
var out = concat1d( x, y );
// returns <ndarray>[ -1.0, 2.0, 3.0, 4.0, -5.0, 6.0, -7.0, -8.0, 9.0, -10.0 ]The function accepts the following arguments:
The data type of the output ndarray is determined by applying type promotion rules. If provided ndarrays having different memory layouts or only scalar inputs, the output ndarray has the default memory layout.
Concatenates provided input arguments and assigns the result to a provided one-dimensional output ndarray.
var array = require( '@stdlib/ndarray/array' );
var zeros = require( '@stdlib/ndarray/zeros' );
var x = array( [ -1.0, 2.0, 3.0, 4.0 ] );
var y = array( [ -5.0, 6.0, -7.0, -8.0 ] );
var z = zeros( [ 8 ] );
var out = concat1d.assign( x, y, z );
// returns <ndarray>[ -1.0, 2.0, 3.0, 4.0, -5.0, 6.0, -7.0, -8.0 ]
var bool = ( out === z );
// returns trueThe function accepts the following arguments:
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var array = require( '@stdlib/ndarray/array' );
var ndarray2array = require( '@stdlib/ndarray/to-array' );
var concat1d = require( '@stdlib/ndarray/concat1d' );
var opts = {
'dtype': 'generic'
};
var x = array( discreteUniform( 6, 0, 10, opts ), opts );
console.log( ndarray2array( x ) );
var y = array( discreteUniform( 8, 0, 10, opts ), opts );
console.log( ndarray2array( y ) );
var out = concat1d( x, y );
console.log( ndarray2array( out ) );| Back | FazBrowse Home | New Git URL |