Advertisement
elcocodrilotito

posibles

Mar 1st, 2019
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.31 KB | None | 0 0
  1. function matriz = posibles(n,m)
  2.     b=@(a,c) 2*n+m-4*c-3*a;
  3.     d=@(a,c) 2*a+3*c-m-n;
  4.     matriz=[];
  5.     for a=0:floor((2*n+m)/3);
  6.         for c=ceil((m+n-2*a)/3):floor((2*n+m-3*a)/4);
  7.             if c<0
  8.                 continue
  9.             end
  10.             matriz=[matriz;a,c];
  11.         end
  12.     end
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement