SHARE
TWEET

neighbor7

a guest Sep 19th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function y=neighbor7(x)
  2. % Troca um membro com seu proximo
  3.     index = randi(length(x));
  4.     aux = x(index);
  5.     y = x;
  6.     if(index < length(x))
  7.         y(index) = x(index+1);
  8.         y(index+1) = aux;
  9.     else
  10.         y(index) = x(index-1);
  11.         y(index-1) = aux;
  12.     end
  13. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top