Contenuto principale

statget

Access field values in statistics options structure

    Description

    val = statget(options,field) returns the value of the field field in the statistics options structure options.

    example

    val = statget(options,field,defaultData) returns defaultData if options.field is empty. Otherwise, the function returns the value of options.field.

    Examples

    collapse all

    Create a default options structure for the factoran function with statset.

    myoptions = statset("factoran");

    Display the value of the TolX field in myoptions.

    statget(myoptions,"TolX")
    ans = 
    1.0000e-08
    

    The value of the TolX field in the default options structure for factoran is 1e-8.

    Display the value of the TolBnd field.

    statget(myoptions,"TolBnd")
    ans =
    
         []
    

    The TolBnd field is empty.

    Input Arguments

    collapse all

    Statistics options, specified as an options structure created using statset.

    Data Types: char | string

    Option field, specified as a character vector or string vector. If field does not contain enough leading characters to uniquely match a field name in options, the function returns an empty value ([]). For a list of available option fields and their descriptions, see the Name-Value Arguments section of the statset reference page.

    Data Types: char | string

    Default data to return if options.field is empty, specified as a value of any data type. If options.field is not empty, statget returns its value.

    Data Types: all

    Version History

    Introduced before R2006a

    See Also