function [VEC,x,count,mutates] = find_mutate(mu,t,N) x = rand(t,N); VEC = ones(1,N); VEC0 = VEC; count = 0; for i =1:t j = find(x(i,:)>1-mu); for k = 1:length(j) if (VEC(j(k))==1) VEC(j(k))=0; else VEC(j(k))=1; end end count = count + length(j); end mutates = sum(abs(VEC-VEC0));