title: Pass Optional Variable in Matlab Genetic Algorithm
body: <p>I have a problem in coding my Genetic Algorithm using Matlab. I am using the <code>ga</code> function and I have no problem with the concepts of <code>ga</code> and how it works. For implementing my object function, I need to pass an extra variable to this function (In addition to the parameters vector). (What I intend is actually trying to mix fittings of different plot and I am integrating the <code>ga</code> function of Matlab in another code of mine). I have tried using global variables and it works fine. But I was just wondering is there any other solution for this problem? As the global variable starts to become bigger and bigger for later tasks.</p>