Anonymous user
Array concatenation: Difference between revisions
m
→{{header|MATLAB}} / {{header|Octave}}
Line 2,226:
=={{header|MATLAB}} / {{header|Octave}}==
Two arrays are concatenated by placing the two arrays between a pair of square brackets. A space between the two array names will concatenate them horizontally, and a semi-colon between array names will concatenate vertically.
<lang MATLAB>>> a = [1 2 3];
>> b = [4 5 6];▼
1 2 3▼
▲>> b = [4 5 6]
>> concat = [a b]
concat =
1 2 3 4 5 6
>> concat = [a;b]
concat =
1 2 3
4 5 6</lang>
Line 2,257 ⟶ 2,242:
>> size(e)
ans =
=={{header|Maxima}}==
|