23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

cat<br />

2cat<br />

Purpose Concatenate arrays<br />

Syntax C = cat(dim,A,B)<br />

C = cat(dim,A1,A2,A3,A4...)<br />

Description C = cat(dim,A,B) concatenates the arrays A and B along dim.<br />

2-212<br />

C = cat(dim,A1,A2,A3,A4,...) concatenates all the input arrays (A1, A2, A3,<br />

A4, and so on) along dim.<br />

cat(2,A,B) is the same as [A,B] and cat(1,A,B) is the same as [A;B].<br />

Remarks When used with comma separated list syntax, cat(dim,C{:}) or<br />

cat(dim,C.field) is a convenient way to concatenate a cell or structure array<br />

containing numeric matrices into a single matrix.<br />

Examples Given,<br />

A = B =<br />

1 2 5 6<br />

3 4 7 8<br />

concatenating along different dimensions produces:<br />

The commands<br />

See Also num2cell<br />

1 2<br />

3 4 1 2 5 6<br />

5 6<br />

3 4 7 8<br />

7 8<br />

C = cat(1,A,B) C = cat(2,A,B) C = cat(3,A,B)<br />

A = magic(3); B = pascal(3);<br />

C = cat(4,A,B);<br />

produce a 3-by-3-by-1-by-2 array.<br />

The special character []<br />

5 6<br />

7 8<br />

1 2<br />

3 4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!