Dataset cat: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
imported>Jeremy
m (Dataset/cat moved to Dataset cat over redirect)
(No difference)

Revision as of 15:06, 8 October 2008

Purpose

Generic concatenation of DataSet objects.

Synopsis

z = cat(dim,a, b, c, ... );

Description

Generic concatenation implies combination of DataSet objects along some specified dimension, dim. Any number of DataSet objects can be concatenated. When dim is 1 or 2, this command is equivalent to [a; b; ...] or [a b ...], respectively (see dataset/vertcat and dataset/horzcat). For this operation to be defined the following must be true:

1) All inputs must be valid DataSet objects or convertible to a DataSet object.

2) The DataSet '.type' fields must all be the same.

3) Concatenation is along the specified dimension (dim). All other dimension sizes must match.

This is similar to matrix concatenation, but each field is treated differently. In structure notation this is:

z.name  = name fields from all DataSet objects are concatenated.
z.type  = a.type;
z.author  = author fields from all DataSet objects are concatenated.
z.date  = date of concatenation
z.moddate  = date of concatenation
z.data  = cat(dim,a.data,b.data,c.data);
z.label  = mode dim label sets are concatenated, and new label sets are created for all other modes
z.axisscale  = mode dim axisscale sets are made empty, and new axisscale sets are created for all other modes
z.title  = new label sets are created
z.class  = mode dim class sets are made empty, and new class sets are created for all other modes
z.description  = concatenates all descriptions
z.userdata = if more than one input has userdata it is filled into a cell array, if only one input has userdata it is returned, else it is empty

Example

The following concatenates two DataSet objects, a and b, along the third dimension (slabs):

 z = cat(3,a,b); %join a and b in the third dimension

See Also

dataset, datasetdemo, dataset/horzcat, dataset/vertcat