📄 mutate.m
字号:
function out=mutate(in,pmutate);
%
% Mutate the incoming chromasome
% with a probability of mutating
% each string of pmutate.
%
% This file takes only one member
% of the overall population.
%
[D L]=size(in);
for i = 1:L
if rand(1)<pmutate
in(1,i)=abs(in(1,i)-1);
end
end
out=in;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -