MATLAB Object-Oriented Programming

(Joyce) #1
ans =
1x20 DocSimpleDouble:
double data:
Columns 1 through 13
1 2 3 4 5 6 7 8 9 10 11 12 13
Columns 14 through 20
14 15 16 17 18 19 20

[sc1;sc2]
ans =
2x10 DocSimpleDouble:
double data:
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20

Concatenate two objects along a third dimension:

c = cat(3,sc1,sc2)

c =

1x10x2 DocSimpleDouble:

double data:

(:,:,1) =

1 2 3 4 5 6 7 8 9 10

(:,:,2) =

11 12 13 14 15 16 17 18 19 20

If the subclass of a built-in class defines properties, you cannot concatenate objects of the
subclass. There is no way to determine how to combine properties of different objects.
However, your subclass can define custom horzcat and vertcat methods to support
concatenation in whatever way makes sense for your subclass.

See Also


Related Examples



  • “Subclasses of Built-In Types Without Properties” on page 12-60


12 How to Build on Other Classes

Free download pdf