Problem 43801. Union Jack Matrix
Create a matrix of odd dimensions that has ones on both diagonals and dividing the matrix into 4 quadrants, resembling a square union jack flag. For example, if n=11:
1 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 1
Solution Stats
Problem Comments
-
1 Comment
Jihye Sofia Seo
on 14 Feb 2017
I wanted to design a problem like this. Very neat!
Solution Comments
Show commentsProblem Recent Solvers80
Suggested Problems
-
Select every other element of a vector
33009 Solvers
-
Sum all integers from 1 to 2^n
15335 Solvers
-
341 Solvers
-
How many trades represent all the profit?
599 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
11394 Solvers
More from this Author11
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!