?? mutation.m
字號:
for i=1:40
if rand<0.1 %通過變異概率
M_pos=round(10*rand);
if M_pos~=0 %若變異位為0則無意義
pop(i,M_pos)=1-pop(i,M_pos);
end
end
if rand<0.1 %通過變異概率
M_pos=round(10*rand);
if M_pos~=0 %若變異位為0則無意義
pop(i,10+M_pos)=1-pop(i,10+M_pos);
end
end
end
clear M_pos;
clear i;
clear k;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -