how to write the fitness function correctly?

1 view (last 30 days)
sethu
sethu on 22 Jun 2015
function f =myfunc(t) r1 = @(v) v(1,:); r2 =@(v) v(2,:); f(:,1) =@(t) r1(sim(net,t')); f(:,2) =@(t) r2(1./sim(net,t')); end
after writing this i am trying to access it using the code
ObjFcn =@myfunc; and then i give some lower and upper bounds and next i use
[X,FVAL] =gamultiobj(objFcn,nvars,[],[],[],[],LB,UB)
but my programm stops at the start saying that "non scalar array of function handles are not allowed ,use cell arrays insted"
some one please tell me how to write that objective function (fittness function file).

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!