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
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
52828 Solvers
-
Remove any row in which a NaN appears
8770 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1263 Solvers
-
Sum of first n positive integers
622 Solvers
-
81 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!