Main Content

gaoptimget

(Not recommended) Obtain values of genetic algorithm options structure

gaoptimget is not recommended. Instead, query options using dot notation. For more information, see Compatibility Considerations.

Syntax

val = gaoptimget(options, 'name')
val = gaoptimget(options, 'name', default)

Description

val = gaoptimget(options, 'name') returns the value of the parameter name from the genetic algorithm options structure options. gaoptimget(options, 'name') returns an empty matrix [] if the value of name is not specified in options. It is only necessary to type enough leading characters of name to uniquely identify it. gaoptimget ignores case in parameter names.

val = gaoptimget(options, 'name', default) returns the 'name' parameter, but will return the default value if the name parameter is not specified (or is []) in options.

Version History

Introduced before R2006a

collapse all

R2018b: gaoptimget is not recommended

To query options, the gaoptimget, psoptimget, and saoptimget functions are not recommended. Instead, use dot notation. For example, to see the setting of the Display option in opts,

displayopt = opts.Display
% instead of
displayopt = gaoptimget(opts,'Display')

Using automatic code completions, dot notation takes fewer keystrokes: displayopt = opts.D Tab.

There are no plans to remove gaoptimget, psoptimget, and saoptimget at this time.