From: ke on 12 May 2010 12:18 I am editing some legacy code in which fminsearch is implemented as, [x, fval] = fminsearch('myfun', x, options, arg1, arg2, arg3) ; where 'myfun' is the name of a saved function myfun.m that takes input arguments x, arg1, arg2, and arg3, each of which are vectors (though most with just one element). myfun.m returns the value fval. In the input list to to fminsearch, x is the initial guess to start the minimization of fval with respect to x. The fminsearch documentation does not mention that the input arguments to myfun can be listed after the optimization options. Is it valid? The code does work. Is there a limit to how many input arguments could be passed in?
From: Matt J on 12 May 2010 12:26 ke <kateedwards11(a)hotmail.com> wrote in message <d799ad45-d7ef-42b6-b8d9-c92df98ae52a(a)e2g2000yqn.googlegroups.com>... > The fminsearch documentation does not mention that the input arguments > to myfun can be listed after the optimization options. Is it valid? > The code does work. Is there a limit to how many input arguments > could be passed in? It's an older style now depreated, but still enabled for backward compatibility's sake.
From: Alan Weiss on 12 May 2010 14:55 On 5/12/2010 12:26 PM, Matt J wrote: > ke <kateedwards11(a)hotmail.com> wrote in message > <d799ad45-d7ef-42b6-b8d9-c92df98ae52a(a)e2g2000yqn.googlegroups.com>... > >> The fminsearch documentation does not mention that the input arguments >> to myfun can be listed after the optimization options. Is it valid? >> The code does work. Is there a limit to how many input arguments >> could be passed in? > > It's an older style now depreated, but still enabled for backward > compatibility's sake. To see the recommended way of passing extra parameters, see http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-7.html Alan Weiss MATLAB mathematical toolbox documentation
From: ke on 12 May 2010 15:11 On May 12, 2:55 pm, Alan Weiss <awe...(a)mathworks.com> wrote: > On 5/12/2010 12:26 PM, Matt J wrote:> ke <kateedward...(a)hotmail.com> wrote in message > > <d799ad45-d7ef-42b6-b8d9-c92df98ae...(a)e2g2000yqn.googlegroups.com>... > > >> The fminsearch documentation does not mention that the input arguments > >> to myfun can be listed after the optimization options. Is it valid? > >> The code does work. Is there a limit to how many input arguments > >> could be passed in? > > > It's an older style now depreated, but still enabled for backward > > compatibility's sake. > > To see the recommended way of passing extra parameters, seehttp://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkgh... > > Alan Weiss > MATLAB mathematical toolbox documentation Thanks to both of you! Mystery solved.
|
Pages: 1 Prev: creating a matrix from an existing matrix Next: superimpose scatter to surf plot |