Dataset subsref

From Eigenvector Documentation Wiki
Jump to: navigation, search

Contents

Purpose

Subindex for DataSet objects using Structure and index notation.

Synopsis

value = x.field{vdim,vset}

Description

General overload for the subsref method. This method handles all generic indexing into the DataSet Object Fields. Below is a summary of the indexing it enables.

  • x = x(rows,columns);

reduces the DataSet object to the specified rows and columns (all fields are indexed). Multi-dimensional indexing is fully supported on n-D DataSet objects.

  • I/O: x = x{batch};

When (x) is a 'batch' type DSO, this extracts the specified batch ((batch) must be a scalar value) and converts the batch to a standard 'data' type DataSet object.

  • value = x.field;

returns the value (value) of the DataSet object field field. This syntax is used for the following fields:

name:  value is a char vector.
author:  value is a char vector.
date:  value is a 6 element vector (see CLOCK).
moddate:  value is a 6 element vector (last modified date).
type:  value is either 'data' or 'image'.
data:  value is a double,single, or [u]int8/16/32 array.
imagemode:  value is a scalar double.
imagesize:  value is a variable-length vector of double.
label:  value is the cell of all labels.
labelname:  value is the cell of all label names.
axisscale:  value is the cell of all axis scales.
axisscalename:  value is the cell of all axis scale names.
title:  value is the cell of all mode titles.
titlename:  value is the cell of all mode title names.
class:  value is the cell of all class identifiers.
classname:  value is the cell of all class identifier names.
include:  value is a cell with vectors for all included indices for all modes.
userdata:  user defined.
description:  value is a char array.
history:  cell array of char (e.g. char(x.history))
datasetversion:  DataSet object version.
  • value = x.field{vdim};

returns the value (value) for the field (field' for the specified dimension/mode vdim.

include: value is row vector of indices for mode vdim
  • value = x.field{vdim,vset};

returns the value (value) for the field (field' for the specified dimension/mode vdim and optional set vset {default: vset=1}. E.g. vset is used when multiple sets of labels are present in x. This syntax is used for the following fields:

label:  value is a char array with size(x.data,vdim) rows.
labelname:  value is a char row vector.
axisscale:  value is a row vector with size(x.data,vdim) real elements.
axisscalename:  value is a char row vector.
title:  value is a char row vector.
titlename:  value is a char row vector.
class:  value is a row vector with size(x.data,vdim) integer elements.
classname:  value is a char row vector.

Examples

plot(mydataset.axisscale{2}) %second dim axis scale
xlabel(mydataset.title{1,2}) %second title for first dim
disp(['Made by: ' mydataset.author])

All calls can be further indexed using standard Matlab notation.

 mydataset.class{2}(5)  %give only the class for the fifth column (item 5 from dim 2)

See Also

DataSet Object Fields, dataset_subsasgn, dataset_get, dataset_explode

Views
Personal tools