| Contents | Index |
Access dataset array properties
get(A)
s = get(A)
p = get(A,PropertyName)
p = get(A,{PropertyName1,PropertyName2,...})
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.
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'| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |