Guest User

Untitled

a guest
May 27th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. function matrices(x)
  2.  
  3. A = [1 2; 3 4];
  4. B = [5 6; 7 8];
  5.  
  6. N = size(A,1);
  7. M = x;
  8.  
  9. if(~mod(M,2))
  10. C = repmat([cat(2,[A B]);cat(2,[B A])],M/2);
  11. else
  12. C = repmat([cat(2,[A B]);cat(2,[B A])],(M+1)/2);
  13. C = C(:,1:end-N);
  14. C = C(1:end-N,:);
  15. end
  16. end
  17.  
  18. D = [1 2 5 6
  19. 3 4 7 8
  20. 5 6 1 2
  21. 7 8 3 4]
  22.  
  23. D = [1 2 5 6 1 2
  24. 3 4 7 8 3 4
  25. 5 6 1 2 5 6
  26. 7 8 3 4 7 8
  27. 1 2 5 6 1 2
  28. 3 4 7 8 3 4]
  29.  
  30. D = [1 2 5 6 1 2 5 6
  31. 3 4 7 8 3 4 7 8
  32. 5 6 1 2 5 6 1 2
  33. 7 8 3 4 7 8 3 4
  34. 1 2 5 6 1 2 5 6
  35. 3 4 7 8 3 4 7 8
  36. 5 6 1 2 5 6 1 2
  37. 7 8 3 4 7 8 3 4]
Add Comment
Please, Sign In to add comment