Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function matrices(x)
- A = [1 2; 3 4];
- B = [5 6; 7 8];
- N = size(A,1);
- M = x;
- if(~mod(M,2))
- C = repmat([cat(2,[A B]);cat(2,[B A])],M/2);
- else
- C = repmat([cat(2,[A B]);cat(2,[B A])],(M+1)/2);
- C = C(:,1:end-N);
- C = C(1:end-N,:);
- end
- end
- D = [1 2 5 6
- 3 4 7 8
- 5 6 1 2
- 7 8 3 4]
- D = [1 2 5 6 1 2
- 3 4 7 8 3 4
- 5 6 1 2 5 6
- 7 8 3 4 7 8
- 1 2 5 6 1 2
- 3 4 7 8 3 4]
- D = [1 2 5 6 1 2 5 6
- 3 4 7 8 3 4 7 8
- 5 6 1 2 5 6 1 2
- 7 8 3 4 7 8 3 4
- 1 2 5 6 1 2 5 6
- 3 4 7 8 3 4 7 8
- 5 6 1 2 5 6 1 2
- 7 8 3 4 7 8 3 4]
Add Comment
Please, Sign In to add comment