DawidS28

edge_id.m

Mar 20th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.26 KB | None | 0 0
  1. function y = edge_id(A,x,y)
  2.     n = -1;
  3.     i=1;
  4.    
  5.     [mx, ~] = size(A);
  6.    
  7.     while n == -1 && i <= mx
  8.         if (A(i,1) == x && A(i,2) == y) || (A(i,1) == y && A(i,2) == x)
  9.             n = i;
  10.         end
  11.         i=i+1;
  12.     end
  13.    
  14.     y = n;
  15. end
Advertisement
Add Comment
Please, Sign In to add comment