?? mate.m
字號:
function [new_gen,mating] = mate(old_gen)%MATE Randomly reorders (mates) OLD_GEN.% [NEW_GEN,MATING] = MATE(OLD_GEN) performs random reordering% on OLD_GEN. NEW_GEN is the new reordering. Individual in % row 1 is to be mated with individual in row 2, etc. MATING% is the reordering vector (ie: new_gen=old_gen(mating,:)).%% Copyright (c) 1993 by the MathWorks, Inc.% Andrew Potvin 1-10-93.[junk,mating] = sort(rand(size(old_gen,1),1));new_gen = old_gen(mating,:);% end mate
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -