I constantly get the error shown below here and I would very much appreciate if anyone could point to what I can do to avoid this. Version is Matlab 2013a. Thanks!
Error using / Matrix dimensions must agree.
Error in boxdirections (line 23) pollParam = 1/sqrt(MeshSize);
Error in mutationadaptfeasible (line 71) [Basis,TangentCone] = boxdirections(true,StepSize,x,linCon.lb,linCon.ub,tol);
Error in stepGA (line 36) mutateKids = feval(options.MutationFcn, parents((1 + 2 * nXoverKids):end), options,GenomeLength,FitnessFcn,state,thisScore,thisPopulation,options.MutationFcnArgs{:});
Error in galincon (line 63) [score,population,state] = stepGA(score,population,options,state,GenomeLength,FitnessFcn);
Error in ga (line 351) [x,fval,exitFlag,output,population,scores] = galincon(FitnessFcn,nvars, …
Error in GAOptimDesign (line 8) [x,fval] = ga(ObjectiveFunction,nvars,[],[],[],[],LB,UB)
The code I am running is as follows, i.e. the ga optimiser from the optimtool:
ObjectiveFunction = @design; nvars = 12; % Number of variables LB = [-3 -3 -3 -3 18 10 10 5 65 65 65 65]; % Lower bound UB = [5 5 5 5 30 25 25 20 75 75 75 75]; % Upper bound
options = gaoptimset('PopulationSize',3) [x,fval] = ga(ObjectiveFunction,nvars,[],[],[],[],LB,UB
The design function is way to large to describe here.
Best Answer