thanks for your help.
Indeed, I'm aware of this part. But i cannot find how to specify correctly the number of variables [6] and options.
[x,fval,exitflag,output] = particleswarm (wrapperfunc, [6], $ANS_MINVAL, $ANS_MAXVAL, options)
Besides, this is a ready to use matlab optimizer.
But I have a custom made optimizer in matlab and i need to call this optimizer which is not ready function in matlab.
This optimizer should receive the computed objectives from Maxwell and send change to the design parameters in Maxwell.
BR Mohamed