Works fine, almost always. However, besides the needed transpose mentioned by Matei, I noticed another problem. Suppose I want 9 clusters from a dataset with 100 elements. Quite often I only get 7 or 8 groups. The same thing happens with other cluster numbers, though I haven't seen it for fewer than wanting 5.
Sanjaya, regarding your second question, try setting the 'ConstrBoundary' option to 'penalize'. Regarding your first question, my code should be able to handle as any variables as you are willing to throw at it, but unfortunately it is not able to handle mixed integer problems. The Genetic Algorithm included in MATLAB's Global Optimzation Toolbox should be able to help you with that.
If you have a time-sensitive question (e.g. academic assignment due), please direct any questions to your professor, teaching assistant, or a classmate. Like most contributors to the File Exchange community, I am not a Mathworks employee and have other responsibilities that I must attend to. I cannot guarantee that I will have the chance to check this page on a regular basis to answer your questions.
Some resources that can help you with any problems that arise while using the toolbox include:
- Genetic Algorithm Toolbox documentation (http://www.mathworks.com/help/gads/genetic-algorithm.html)
- The books, academic paper, and Wikipedia article listed in the "bibliography" section of the file description
It is very sad that you have not replied my query till yet.Again I am facing another problem with your code which I am explaining.
I am getting the fitness function from a simulink file. The simulink file will run if the variables lie within lower bound and upper bound.But with your code sometimes the variables exceed the lower bound or upper bound so that the simulink file is not able to execute and it shows error.So please help me as soon as possible. Thanks.