2014-05-18 22:21:00 +02:00

823 B

Function concat

Concatenate two or more matrices.

Syntax

math.concat(A, B, C, ...)
math.concat(A, B, C, ..., dim)

Parameters

Parameter Type Description
args ... Array | Matrix Two or more matrices

Returns

Type Description
Array | Matrix Concatenated matrix

Examples

var math = mathjs();

var A = [[1, 2], [5, 6]];
var B = [[3, 4], [7, 8]];

math.concat(A, B);      // returns [[1, 2, 3, 4], [5, 6, 7, 8]]
math.concat(A, B, 0);   // returns [[1, 2], [5, 6], [3, 4], [7, 8]]

See also

size, squeeze, subset, transpose