User`s guide

2 MATLAB 6.1 Release Notes
2-12
External Interfaces/API Features
Concatenation of Java Arrays
In MATLAB 6.1, you can concatenate arrays of Java objects that have unlike
dimensions. The following example concatenates a 2-by-3 array of
java.lang.Integer with a 4-by-3 array of the same class.
A =
java.lang.Integer[][]:
[ 1] [ 2] [ 3]
[ 4] [ 5] [ 6]
[17] [18] [19]
[20] [21] [22]
B =
java.lang.Integer[][]:
[11] [12] [13]
[14] [15] [16]
The vertical concatenation [A;B] is simple since both arrays have the same
number of columns. The horizontal concatenation
[A B] merges the two arrays
into an irregularly shaped array having six columns in the first and second
rows and three columns in the third and fourth rows.
C = [A;B] C = [A B]
C = C =
java.lang.Integer[][]: java.lang.Integer[][]:
[ 1] [ 2] [ 3] [6 element array]
[ 4] [ 5] [ 6] [6 element array]
[11] [12] [13] [3 element array]
[14] [15] [16] [3 element array]
[17] [18] [19]
[20] [21] [22]
Note “Concatenation of Java Objects” on page 2-30 discusses changes to how
Java objects are concatenated.