From: Richard on
I am trying to use fminsearch within a parfor loop, so I can't use global variables to pass objects. How can I pass objects (vectors and matrices) generated within my fminsearch function--aside from x and fval--to the m-file calling the fminsearch function in a way that is acceptable within a parfor loop?
From: Alan Weiss on
Richard wrote:
> I am trying to use fminsearch within a parfor loop, so I can't use global variables to pass objects. How can I pass objects (vectors and matrices) generated within my fminsearch function--aside from x and fval--to the m-file calling the fminsearch function in a way that is acceptable within a parfor loop?
I am not sure what intermediate values you want to pass, but you can
probably access them using an "output function." See the doc:
http://www.mathworks.com/access/helpdesk/help/techdoc/math/f2-14970.html#f2-935126

Alan Weiss
MATLAB mathematical toolbox documentation