Advertisement
rsvaco

tal pract 2 ej 9

Oct 27th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. Ejercicio9[afn_] := Module[{i, j, res, nuevosf, cond},
  2. nuevosf = {};
  3. res = afn;
  4. For[i = 1, i <= Length[afn[[1]]], i++,
  5. cond = True;
  6. For[j = 1, j <= Length[afn[[2]]], j++,
  7. If[Length[Cases[afn[[3]], {afn[[1]][[i]], afn[[2]][[j]], _}] ] <=
  8. 1,
  9. cond = cond && True;,
  10. cond = False;
  11. ];
  12. ];
  13. If[cond,
  14. nuevosf = Join[nuevosf, {afn[[1]][[i]]}];
  15. ];
  16. ];
  17.  
  18.  
  19. res[[5]] = nuevosf;
  20.  
  21. Return[res];
  22. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement