|
"Giovanni" <pireddag@hotmail.com> wrote in message <h7uoe1$h00$1@fred.mathworks.com>...
> One of my programs, that runs in about 100 seconds in Matlab r2009a, runs now in about 200 seconds in r2009b. After profiling, I found that the main culprit is the
>
> options = optimset(options);
>
> call inside the optionFeedback = createOptionFeedback(options) function that in turn is called by the fsolve function; according to the profiler the line
>
> optionFeedback = createOptionFeedback(options)
>
> takes more time than the line
>
> [x,FVAL,JACOB,EXITFLAG,OUTPUT,msgData]=...
> 378 trustnleqn(funfcn,x,verbosity,gradflag,options,defaultopt,f,JAC,...
> 379 detailedExitMsg,optionFeedback,varargin{:});.
>
> which is the main core of the program. I did not find any mention of this on the help files (tried a search with createOptionFeedback). Did I just miss the mention of it in the help (how to turn it off, I mean :-) )
> I would avoid tinkering with the fsolve file itself if there is an "official" way of turning off that sort of nasty line.
>
> Thanks in advance for any reply.
Hi,
The expense to call 'createOptionFeedback' should be constant (typically less than a fraction of a second) irrespective of the problem size. I am guessing that you are running fsolve in a loop where each problem is relatively cheap so the overhead of calling 'createOptionFeedback' is lot more than actually solving the problem.
If you are calling fsolve in a loop then try to keep the call to optimset (to set your option) outside the loop. You can pass a simple structure to fsolve.
Rakesh
|