"gita indah" <email@example.com> wrote in message news:firstname.lastname@example.org... > Now i'm using Matlab R2009a. > I've tried to use Open Genetic Algorithm Toolbox framework. > Every time I execute the GA GUI, there are some error occured. > > For example if I choose knapsack problem, here's the code : > > [population, stats] = GA(knapsack_initialize()); > Please enter the size of the knapsack: 100 > > When I executed it, these errors occured : > > ??? Error: File: knapsack_generate_random.m Line: 1 Column: 60 > Unexpected MATLAB operator. > > > > When I followed this error, it refers to : > > function [ solution ] = knapsack_generate_random( problem, ~ ) > > The '~' operator is the problem. > > Please tell me what happen actually and how to solve this problem.
That syntax was introduced in release R2009b and the File Exchange submission indicates it was created with release R2011a of MATLAB:
Since this toolbox uses features not present in your version of MATLAB, it will not work as written. You will need to modify it to avoid using features that were introduced in releases R2009b, R2010a, R2010b, and R2011a, or contact the author and ask them to modify it, or update your version of MATLAB to one that contains all the language features used by that code.