isoperator.m
来自「遗传规划的matlab工具箱」· M 代码 · 共 24 行
M
24 行
function isit=isoperator(operatornames,possibleoperator)
%ISOPERATOR True for GPLAB algorithm operator.
% ISOPERATOR(OPERATORNAMES,POSSIBLEOPERATOR) returns the operator
% number 1,2... (true) if POSSIBLEOPERATOR is in OPERATORNAMES,
% or 0 (false) otherwise.
%
% Input arguments:
% OPERATORNAMES - an array with names of operators (cell array)
% POSSIBLEOPERATOR - the name of a possible operator (string)
% Output argument:
% the number of the operator, or false (integer)
%
% Copyright (C) 2003-2004 Sara Silva (sara@dei.uc.pt)
% This file is part of the GPLAB Toolbox
isit=find(strcmp(operatornames,possibleoperator));
if isempty(isit)
isit=0;
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?