?? mutation1.m
字號:
function v1=mutation1(c1,k)
%變異算子,前0.02,中0.03,后0.02
if k<=30
pm=0.02;
elseif k>30 & k<=50
pm=0.03;
else
pm=0.02;
end
format long;
population=10;
for i=1:population
for j=1:8
r=rand(1);
if r>pm
temp(i,j)=c1(i,j);
else
tt=not(str2num(c1(i,j)));
temp(i,j)=num2str(tt);
end
end
end
v1=temp;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -