binousga2.m

来自「基于GA工具箱对坦克进行动态控制仿真」· M 代码 · 共 28 行

M
28
字号
% Author: Housam Binous% Dynamic and control of a tank using the genetic algorithm toolbox% National Institute of Applied Sciences and Technology, Tunis, TUNISIA% Email: binoushousam@yahoo.comfunction [X,FVAL,REASON,OUTPUT,POPULATION,SCORES] =  binousga2%%   This is an auto generated M file to do optimization with the Genetic Algorithm and%    Direct Search Toolbox. Use GAOPTIMSET for default GA options structure.global t1 h sys X%%Fitness functionfitnessFunction = @obj2;%%Number of Variablesnvars = 3 ;%Start with default optionsoptions = gaoptimset;%%Modify some parametersoptions = gaoptimset(options,'PopInitRange' ,[0  0  0 ;5  2  5]);options = gaoptimset(options,'SelectionFcn' ,@selectionuniform);options = gaoptimset(options,'MutationFcn' ,{ @mutationuniform 0.21 });options = gaoptimset(options,'Display' ,'off');%%Run GA[X,FVAL,REASON,OUTPUT,POPULATION,SCORES] = ga(fitnessFunction,nvars,options);

⌨️ 快捷键说明

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