|
Hi everybody
I have a nonlinear constraint minimization problem and i try to solve it with fmincon, but since i have 238 variable fmincon works very slow. To seed up i want to use parallel computing. In matlab help forums i found:
matlabpool open 2
options = optimset('UseParallel','always');
fmincon(...,options)
matlabpool close
but whenever i use this way it gives error as:
??? Error using ==> parallel_function at
598
Error in ==> objective at 12
Matrix dimensions must agree.
Error in ==> parfinitedifferences at 110
parfor(gcnt=1:nVar)
Error in ==> nlconst at 355
[gf,gnc(:,nonlIneqs_idx),gnc(:,nonlEqs_idx),numEvals]
= ...
Error in ==> fmincon at 724
[X,FVAL,LAMBDA,EXITFLAG,OUTPUT,GRAD,HESSIAN]=...
When i remove matlabpool open 2 and matlabpool close, the algorithm works without error but in that case i noticed it does not work as parallel.
Can anybody help to figure out why i am getting this error?
Regards
|