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
-
How to find the position of an element in a vector without using the find function
2816 Solvers
-
Back to basics 25 - Valid variable names
339 Solvers
-
Make a vector of prime numbers
969 Solvers
-
612 Solvers
-
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
939 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!