gtrans.m

来自「人工免疫算法程序,请大家多多关注」· M 代码 · 共 17 行

M
17
字号
function Gpath=GTrans(path)
%进行Grefenstette编码转换
[row,col]=size(path);
for i=1:row
    temptable=1:col;
    for j=1:col
        for k=1:length(temptable)
            if path(i,j)==temptable(k)
                Gpath(i,j)=k;
                temptable(k)=[];
                break;
            end
        end
    end
end

        

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?