dsSubset
Subset of a dataset
Contents
Syntax
- ds2=dsSubset(ds, opt)
Description
ds2=dsSubset(ds, opt): return a subset of the given ds based on the given opt
- Usage 1:
- opt.input: input names or indices to be retained.
- opt.output: output names of indices to be retained.
- Usage 2:
- opt.inputName: input name to be checked.
- opt.inputValue: input value to be checked. Only the data entries with the input name equal to the input value will be retained.
Example
ds=prData('iris'); disp(ds) opt=dsSubset('defaultOpt'); opt.input={'petal length', 'petal width'}; ds2=dsSubset(ds, opt); disp(ds2)
dataName: 'iris'
inputName: {'sepal length' 'sepal width' 'petal length' 'petal width'}
outputName: {'Setosa' 'Versicolour' 'Virginica'}
input: [4×150 double]
output: [1×150 double]
dataName: 'iris'
inputName: {'petal length' 'petal width'}
outputName: {'Setosa' 'Versicolour' 'Virginica'}
input: [2×150 double]
output: [1×150 double]