To those who are looking to constrain parameters to a certain range, the easiest way is to constrain the Generator option. For example: Generator = @(x) (rand(3,1)); will only return results in the unit cube. You can also make your own Generator = @(x)myRand(x); to return only points in any domain you choose.
This function worked really well right off the bat, thanks! Is there a way to incorporate bounds for the parameters? I'm simulating some electrophysiological data, and I want to constrain the parameters to realistic values.
Thanks so much! worked first time, out of the box, without modification to my previous code, to solve a family of problems that fminsearch could not. Which is better than most built-in matlab functions manage!