get - Access dataset array properties

Class

@dataset

Syntax

get(A)
s = get(A)
p = get(A,PropertyName)
p = get(A,{PropertyName1,PropertyName2,...})

Description

get(A) displays a list of property/value pairs for the dataset array A.

s = get(A) returns the values in a scalar structure s with field names given by the properties.

p = get(A,PropertyName) returns the value of the property specified by the string PropertyName.

p = get(A,{PropertyName1,PropertyName2,...}) allows multiple property names to be specified and returns their values in a cell array.

Example

Create a dataset array from Fisher's iris data and access the information:

load fisheriris
NumObs = size(meas,1);
NameObs = strcat({'Obs'},num2str((1:NumObs)','%d'));
iris = dataset({nominal(species),'species'},...
               {meas,'SL','SW','PL','PW'},...
               'ObsNames',NameObs);

get(iris)
   Description: ''
   Units: {}
   DimNames: {'Observations' 'Variables'}
   UserData: []
   ObsNames: {150x1 cell}
   VarNames: {'species' 'SL' 'SW' 'PL' 'PW'}

ON = get(iris,'ObsNames');
ON(1:3)
ans = 
    'Obs1'
    'Obs2'
    'Obs3'

See Also

set, summary

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS