Applying fminsearch on one SCALAR output of a VECTOR function. How can I get other corresponding outputs w/o recomputing my function?

Hi
fminsearch finds the minimum of a SCALAR function of several variables.
I have a VECTOR function. [output1, output2] = myfun(x), where output1 is a SCALAR. It takes a while to run my function.
I am running: [x] = fminsearch( @(x) myfun(x) , 0) which finds the x that minimises output1.
Question: is there a way of retrieving output2 without having to rerun myfun?
Thank you.

Answers (0)

This question is closed.

Tags

Asked:

on 20 Oct 2011

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!