gaguigeneratemfile.m

来自「matlab7 gads工具箱」· M 代码 · 共 30 行

M
30
字号
function gaguigeneratemfile(probmodel, optmodel, randchoice)
%GAGUIGENERATEMFILE generates an mfile from gatool. 

%   Copyright 2004 The MathWorks, Inc.
%   $Revision: 1.6 $ $Date: 2004/01/16 16:50:57 $

[fitnessFcn,nvars,randstate,randnstate] =  gaguiReadProblem(probmodel);

options = gaguiReadHashTable(optmodel);

%remove special gui outputfcn which is the first in the list
if ~isempty(options.OutputFcns) 
    temp = options.OutputFcns{1};
    temp = temp{1};
    if strcmp(func2str(temp), 'gatooloutput')
        options.OutputFcns(1) = [];
    end
end
%Create a struct for generateMfile
tempstruct = struct;
tempstruct.fitnessfcn = fitnessFcn;
tempstruct.nvars = nvars;
if randchoice
    tempstruct.randstate = randstate;
    tempstruct.randnstate = randnstate;
end
tempstruct.options=options;
%Call generate Mfile code
generateMfile(tempstruct, 'ga');

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?