📄 mutation_2d.m
字号:
function [v10,v11]=mutation_2d(c10,c11)
%变异算子
format long;
population=20;
pm=0.03;
for i=1:population
for j=1:8
r0=rand(1);
r1=rand(1);
if r0>pm
temp0(i,j)=c10(i,j);
else
tt=not(str2num(c10(i,j)));
temp0(i,j)=num2str(tt);
end
if r1>pm
temp1(i,j)=c11(i,j);
else
tt=not(str2num(c11(i,j)));
temp1(i,j)=num2str(tt);
end
end
end
v10=temp0;
v11=temp1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -