options = statset()
options = statset(statfun)
options = statset(Name, Value, ...)
options = statset(oldOptions, Name, Value, ...)
| Parameter | Description |
|---|---|
| statfun | statistics function name used to initialize defaults, such as 'kmeans'. |
| Name, Value | option names and values. Names can be abbreviated when the abbreviation is unique. |
| oldOptions | existing scalar options structure to update or merge. |
| Parameter | Description |
|---|---|
| options | scalar structure containing statistics options fields. |
statset creates a scalar structure with common statistics options. The structure can be passed to functions that accept an Options name-value argument.
Parallel and stream option fields are accepted by statistics functions that support them. Execution can remain serial when a function does not use parallel evaluation. Streams can contain a RandStream object or a cell array of streams.
opts = statset('kmeans');
opts.Display
opts.MaxIter
X = [0 0; 0 1; 5 5; 5 6];
opts = statset('kmeans', 'Display', 'final', 'MaxIter', 20);
[idx, C] = kmeans(X, 2, 'Start', [0 0; 5 5], 'Options', opts)
opts = statset('UseParallel', true, 'UseSubstreams', true, 'Streams', {});
statget(opts, 'UseParallel')