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:
fmincon output display

Subject: fmincon output display

From: mohamad ali

Date: 21 Jul, 2011 02:12:09

Message: 1 of 4

Hello everyone,

Am workin on a minmization problem using fmincon.I have all my constraints written down and my A matrix and objective function are ready.I wanted to see every value of of T (answer of the objective function) and save all the results in a vector that would appear in the workspace after running the whole script.

Thanks in advance....Hope somebody would reply asap

Subject: fmincon output display

From: saeed kamelian

Date: 21 Jul, 2011 08:11:08

Message: 2 of 4

"mohamad ali " <itani.mai@hotmail.com> wrote in message <j081tp$qa1$1@newscl01ah.mathworks.com>...
> Hello everyone,
>
> Am workin on a minmization problem using fmincon.I have all my constraints written down and my A matrix and objective function are ready.I wanted to see every value of of T (answer of the objective function) and save all the results in a vector that would appear in the workspace after running the whole script.
>
> Thanks in advance....Hope somebody would reply asap
Dear Mohhmad Ali
for having all value of optimization iterations you can use the option parameter of the function fmincon.
you can use the command followed:
options=optimset('Display','iter');
[x,fval,exitflag]=fmincon(...,options);

Subject: fmincon output display

From: Rakesh Kumar

Date: 21 Jul, 2011 15:48:09

Message: 3 of 4

"mohamad ali " <itani.mai@hotmail.com> wrote in message <j081tp$qa1$1@newscl01ah.mathworks.com>...
> Hello everyone,
>
> Am workin on a minmization problem using fmincon.I have all my constraints written down and my A matrix and objective function are ready.I wanted to see every value of of T (answer of the objective function) and save all the results in a vector that would appear in the workspace after running the whole script.
>
> Thanks in advance....Hope somebody would reply asap

You can use an output function to get the iterates in every iteration and save that in either a MAT file or an appdata. There are many other ways you can do this. See this example on output function:
http://www.mathworks.de/help/toolbox/optim/ug/brhkghv-56.html

Hth,
Rakesh

Subject: fmincon output display

From: mohamad ali

Date: 24 Jul, 2011 16:56:08

Message: 4 of 4

Hey guys,
Thanks for ur fast responses.....Both ideas actually worked.....so Props...:D

Mohamad Ali

Tags for this Thread

No tags are associated with 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