This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Class: dataset

Set and display properties

The dataset data type might be removed in a future release. To work with heterogeneous data, use the MATLAB® table data type instead. See MATLAB table documentation for more information.


A = set(A,PropertyName,PropertyValue,...)
B = set(A,PropertyName,value)


set(A) displays all properties of the dataset array A and their possible values.

set(A,PropertyName) displays possible values for the property specified by PropertyName.

A = set(A,PropertyName,PropertyValue,...) sets property name/value pairs.

B = set(A,PropertyName,value) returns a dataset array B that is a copy of A, but with the property 'PropertyName' set to the value value.

    Note:   Using set(A,'PropertyName',value) without assigning to a variable does not modify A's properties. Use A = set(A,'PropertyName',value) to modify A.


Create a dataset array from Fisher's iris data and add a description:

load fisheriris
NumObs = size(meas,1);
NameObs = strcat({'Obs'},num2str((1:NumObs)','%-d'));
iris = dataset({nominal(species),'species'},...
iris = set(iris,'Description','Fisher''s Iris Data');
   Description: 'Fisher's Iris Data'
   Units: {}
   DimNames: {'Observations' 'Variables'}
   UserData: []
   ObsNames: {150x1 cell}
   VarNames: {'species' 'SL' 'SW' 'PL' 'PW'}

See Also


Was this topic helpful?