Dataset delsamps: Difference between revisions
imported>Jeremy m (Dataset delsamps moved to Dataset/delsamps) |
imported>Jeremy m (Dataset/delsamps moved to Dataset delsamps over redirect) |
(No difference)
|
Revision as of 15:07, 8 October 2008
Purpose
Deletes or excludes the specified samples, rows, or other dimension from a DataSet object.
Synopsis
- eddata = delsamps(data,inds,vdim,flag)
Description
DELSAMPS modifies the include field of a DataSet to mark rows or columns to be "excluded" keeping the data in the DataSet (i.e. soft delete). It can also be used to permanently remove rows or columns from a DataSet object (i.e. hard delete). Inputs are the original DataSet object, data, and the indices to mark, inds. Optional input vdim is the mode/dimension to mark
- 1=rows {default}, and
- 2=columns, etc.
Optional input (flag) indicates to mark/soft delete when set to 1 {default}, hard delete when set to 2, or hard "keep" when set to 3. The output is the edited DataSet object (eddata).
Examples
The first example returns a DataSet object with the first two rows (samples) excluded (soft delete), the second hard-deletes the first two columns:
a = delsamps(a,[1 2]); %soft delete rows 1 and 2 a = delsamps(a,[1 2],2,2); %hard delete columns 1 and 2
When flag = 3, the function of inds is inverted and indicates the indices to keep (all others are deleted). The order the indices appear in inds specifies the new order of the rows/columns/etc. in the result. Thus, the delsamps command
eddata = delsamps(data,inds,2,3);
is equivalent to performing the operation (see dataset/subsref):
eddata = data(:,inds);