function Mut = mutation(Rec) % This function performs the mutation operation after recombination % We change the position of one queen in the whole population temp_rnd_1=round(9*rand+1); temp_rnd_2=round(7*rand+1); temp_rnd_3=round(7*rand+1); Rec(:,temp_rnd_2,temp_rnd_1)=0; Rec(temp_rnd_3,temp_rnd_2,temp_rnd_1)=1; Mut=Rec; end