LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing additional arguments to fminsearch

I would like to pass some additional arguments to the function fminsearch.  In matlab, this is usually done using an annomous function ie:

 

X = fminsearch(@(x) myfun(x, y), x0),

 

where myfun is the function that I’m trying to minimize and y is the additional argument that I want to pass.  What is the best way to do this using mathscript?

 

Jim

0 Kudos
Message 1 of 2
(7,816 Views)
Hello Jim,

Currently we don't have a mechanism for passing multiple parameters to the function used by fminsearch.  One solution that might work for you is to make y a global variable in your calling script as well as in your myfun function.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 2
(7,804 Views)