Main Content

set

Assign values in fit options structure

Description

set(options) displays all property names of the fit options structure options. If a property has a finite list of possible character vector values, these values are also displayed.

s = set(options) returns a structure s with the same property names as options. If a property has a finite list of possible character vector values, the value of the property in s is a cell array containing the possible character vector values. If a property does not have a finite list of possible character vector values, the value of the property in s is an empty cell array.

set(options,field1,val1,field2,val2,...) sets the properties specified by the character vectors field1, field2, ... to the values val1, val2, ..., respectively.

example

set(options,fields,vals) sets the properties specified by the cell array of character vectors fields to the corresponding values in the cell array vals.

example

Examples

collapse all

Create a custom nonlinear model, and create a default fit options structure for the model:

f = fittype('a*x^2+b*exp(n*c*x)','problem','n');
options = fitoptions(f);

Set the Robust and Normalize properties of the fit options structure using property name/value pairs:

set(options,'Robust','LAR','Normalize','On')

Set the Display, Lower, and Algorithm properties of the fit options structure using cell arrays of property names/values:

set(options,{'Disp','Low','Alg'},...
         {'Final',[0 0 0],'Levenberg'})

Input Arguments

collapse all

fitoptions object of which you want to set the property names and values, specified as a fitoptions object.

Property fields, specified as a character vector, of the fitoptions object options that you want to set to the values val1, val2, ..., respectively, specified as a scalar, a vector, or a matrix.

Data Types: char

Property field of the fitoptions object options that you want to set, specified as string scalar, character vector, or a cell array of character vectors.

Data Types: char | string | cell

Values of the fitoptions object options that you want to set the fields to, specified as a cell array.

Data Types: cell

Output Arguments

collapse all

Copy of the fitoptions object options, returned as a fitoptions object.

Version History

Introduced before R2006a

See Also

|