Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
optimoptions

Subject: optimoptions

From: Nikola

Date: 23 Mar, 2013 19:18:05

Message: 1 of 4

Hi all,

I am trying to set options for a hybrid function within a genetic algorithm. The online documentation recommends the following:

hybridopts = optimoptions('fminunc','Display','iter','Algorithm','quasi-newton');
options = gaoptimset(options,'HybridFcn',{@fminunc,hybridopts});

However, I am getting the following error:

??? Undefined function or method 'optimoptions' for input arguments of type 'char'.

I tried this Matlab 2010b and 2011a and it did not work. I also tried @fminunc instead of 'fminunc', but it didn't work either.

I'd greatly appreciate any feedback.

Nikola

Subject: optimoptions

From: Alan_Weiss

Date: 25 Mar, 2013 12:56:12

Message: 2 of 4

On 3/23/2013 3:18 PM, Nikola wrote:
> Hi all,
>
> I am trying to set options for a hybrid function within a genetic
> algorithm. The online documentation recommends the following:
>
> hybridopts =
> optimoptions('fminunc','Display','iter','Algorithm','quasi-newton');
> options = gaoptimset(options,'HybridFcn',{@fminunc,hybridopts});
> However, I am getting the following error:
>
> ??? Undefined function or method 'optimoptions' for input arguments of
> type 'char'.
>
> I tried this Matlab 2010b and 2011a and it did not work. I also tried
> @fminunc instead of 'fminunc', but it didn't work either.
>
> I'd greatly appreciate any feedback.
>
> Nikola
optimoptions is new for R2013a. To see older doc on the topic:
http://www.mathworks.com/help/releases/R2012b/gads/genetic-algorithm-options.html#f17822

Basically, you just use
hybridopts = optimset('Display','iter','Algorithm','quasi-newton');
in place of the optimoptions call.

Alan Weiss
MATLAB mathematical toolbox documentation

Subject: optimoptions

From: Alan_Weiss

Date: 25 Mar, 2013 14:27:38

Message: 3 of 4

On 3/25/2013 8:56 AM, Alan_Weiss wrote:
> On 3/23/2013 3:18 PM, Nikola wrote:
>> Hi all,
>>
>> I am trying to set options for a hybrid function within a genetic
>> algorithm. The online documentation recommends the following:
>>
>> hybridopts =
>> optimoptions('fminunc','Display','iter','Algorithm','quasi-newton');
>> options = gaoptimset(options,'HybridFcn',{@fminunc,hybridopts});
>> However, I am getting the following error:
>>
>> ??? Undefined function or method 'optimoptions' for input arguments
>> of type 'char'.
>>
>> I tried this Matlab 2010b and 2011a and it did not work. I also tried
>> @fminunc instead of 'fminunc', but it didn't work either.
>>
>> I'd greatly appreciate any feedback.
>>
>> Nikola
> optimoptions is new for R2013a. To see older doc on the topic:
> http://www.mathworks.com/help/releases/R2012b/gads/genetic-algorithm-options.html#f17822
>
>
> Basically, you just use
> hybridopts = optimset('Display','iter','Algorithm','quasi-newton');
> in place of the optimoptions call.
>
> Alan Weiss
> MATLAB mathematical toolbox documentation

Oh, one other thing. The fminunc Algorithm option is also new for
R2013a. You want the following:

hybridopts = optimset('Display','iter','LargeScale','off');

See the release notes:
http://www.mathworks.com/help/optim/release-notes.html

Alan Weiss
MATLAB mathematical toolbox documentation

Subject: optimoptions

From: Nikola

Date: 26 Mar, 2013 03:22:05

Message: 4 of 4

Alan_Weiss <aweiss@mathworks.com> wrote in message <kipmsq$7d6$1@newscl01ah.mathworks.com>...
> On 3/25/2013 8:56 AM, Alan_Weiss wrote:
> > On 3/23/2013 3:18 PM, Nikola wrote:
> >> Hi all,
> >>
> >> I am trying to set options for a hybrid function within a genetic
> >> algorithm. The online documentation recommends the following:
> >>
> >> hybridopts =
> >> optimoptions('fminunc','Display','iter','Algorithm','quasi-newton');
> >> options = gaoptimset(options,'HybridFcn',{@fminunc,hybridopts});
> >> However, I am getting the following error:
> >>
> >> ??? Undefined function or method 'optimoptions' for input arguments
> >> of type 'char'.
> >>
> >> I tried this Matlab 2010b and 2011a and it did not work. I also tried
> >> @fminunc instead of 'fminunc', but it didn't work either.
> >>
> >> I'd greatly appreciate any feedback.
> >>
> >> Nikola
> > optimoptions is new for R2013a. To see older doc on the topic:
> > http://www.mathworks.com/help/releases/R2012b/gads/genetic-algorithm-options.html#f17822
> >
> >
> > Basically, you just use
> > hybridopts = optimset('Display','iter','Algorithm','quasi-newton');
> > in place of the optimoptions call.
> >
> > Alan Weiss
> > MATLAB mathematical toolbox documentation
>
> Oh, one other thing. The fminunc Algorithm option is also new for
> R2013a. You want the following:
>
> hybridopts = optimset('Display','iter','LargeScale','off');
>
> See the release notes:
> http://www.mathworks.com/help/optim/release-notes.html
>
> Alan Weiss
> MATLAB mathematical toolbox documentation

Thanks a lot Alan for your help and explanations.
Nikola

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us