Prev: classregtree modification for other split criterion (with multiple responses Ys)
Next: CHANGING MATLAB FILE NAME???
From: Danyang on 14 May 2010 03:07 I am trying to use matlab fmincon function: the objective function is: simulator.runSimulation(vector); and it doesn't run. I figured the reason being that to define a class method, I have to add class name as a variable, e.g. a=runSimulation(simulator, vector). Here we have two arguments, which does not work with fmincon.The runSimulation function is very complicated, and there is no way of pulling it out of the class. Can anyone show me how to avoid that problem? much thanks!
From: Steven Lord on 14 May 2010 09:45
"Danyang " <fnosdy(a)umich.edu> wrote in message news:hsisqo$ge5$1(a)fred.mathworks.com... > > I am trying to use matlab fmincon function: the objective function is: > simulator.runSimulation(vector); and it doesn't run. I figured the reason > being that to define a class method, I have to add class name as a > variable, e.g. a=runSimulation(simulator, vector). Here we have two > arguments, which does not work with fmincon.The runSimulation function is > very complicated, and there is no way of pulling it out of the class. Can > anyone show me how to avoid that problem? much thanks! Assuming you're using MATLAB 7.0 (R14) or later: fmincon(@(vector) runSimulation(simulator, vector), ...) -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ |