1、initialzega函数创建
高版本(大约是2015a)之后不再支持initialzega函数,所以需要使用的话要自己创建函数,具体如下:创建initialzega.m内容为:
function [pop] = initializega(num, bounds, evalFN,evalOps,options)
% function [pop]=initializega(populationSize, variableBounds,evalFN,
% evalOps,options)
% initializega creates a matrix of random numbers with
% a number of rows equal to the populationSize and a number
% columns equal to the number of rows in bounds plus 1 for
% the f(x) value which is found by applying the evalFN.
% This is used by the ga to create the population if it
% is not supplied.
%
% pop - the initial, evaluated, random population
% populatoinSize - the size of the population, i.e. the number to create
% variableBounds - a matrix which contains the bounds of each variable, i.e.
% [var1_high var1_low;