Given n (always odd), return output a that has concentric rings of the 1s and 0s around the center point. Examples:
Input n = 3
Output a is [ 1 1 1
1 0 1
1 1 1 ]
Input n = 5
Output a is [ 1 1 1 1 1
1 0 0 0 1
1 0 1 0 1
1 0 0 0 1
1 1 1 1 1]
Additional test cases have been added.
Do you know if Matrix Patterns II and Sequences & Series III will become badge eligible problem sets? Thanks!
sorry,just test for regexp solution,it really is not a proper way to do cody.
Find the sum of all the numbers of the input vector
pressure to dB?
Scoring for oriented dominoes
Replace Nonzero Numbers with 1
Put Two 1D matrices into one 1D matrix
Generate binary combinations for a given number of bit(s)
BULLSEYE Part 3: Reference Problem 18 BULLSEYE
Make combination of two given matrices.
Power The Product
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office