find.m
来自「一些经典遗传算法问题的matlab程序调度问题分配问题等等」· M 代码 · 共 15 行
M
15 行
function ind = find(chr,name)
% FIND - finds the index of a chromosome with a specific name in an array.
% index=find(chr,'name') if the chromosome is not found the function
% returns zero
ind=[];
for k=1:length(chr)
if strcmp(chr(k).name,name);
ind=[ind k];
end
end
if isempty(ind)
ind=0;
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?