create matrix like below --
for x=2,
y=[1 1 1 1 1; 1 2 2 2 1; 1 2 3 2 1; 1 2 2 2 1; 1 1 1 1 1] . for x=3, y=[1 1 1 1 1 1 1 1 1; 1 2 2 2 2 2 2 2 1; 1 2 3 3 3 3 3 2 1; 1 2 3 4 4 4 3 2 1; 1 2 3 4 5 4 3 2 1; 1 2 3 4 4 4 3 2 1; 1 2 3 3 3 3 3 2 1; 1 2 2 2 2 2 2 2 1; 1 1 1 1 1 1 1 1 1]
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers20
Suggested Problems
-
Find state names that end with the letter A
1197 Solvers
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
2001 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
3681 Solvers
-
Determine if input is a perfect number
264 Solvers
-
112 Solvers
More from this Author174
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!