📄 binousga2.m
字号:
% 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -