Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function y=neighbor7(x)
- % Troca um membro com seu proximo
- index = randi(length(x));
- aux = x(index);
- y = x;
- if(index < length(x))
- y(index) = x(index+1);
- y(index+1) = aux;
- else
- y(index) = x(index-1);
- y(index-1) = aux;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement