Test if a value is matrix-like.
var isMatrixLike = require( '@stdlib/utils/is-matrix-like' );
Tests if a value is matrix-like.
var mat = {
'data': new Int8Array( 10 ),
'shape': [5,2],
'offset': 0,
'strides': [2,1],
'dtype': 'int8',
'length': 10
};
console.log( isMatrixLike( mat ) );
// returns true
var isMatrixLike = require( '@stdlib/utils/is-matrix-like' );
var mat = {
'data': new Int8Array( 10 ),
'shape': [5,2],
'offset': 0,
'strides': [2,1],
'dtype': 'int8',
'length': 10
};
console.log( isMatrixLike( mat ) );
// returns true
console.log( isMatrixLike( [] ) );
// returns false
console.log( isMatrixLike( {} ) );
// returns false
console.log( isMatrixLike( null ) );
// returns false