Generate a matrix like Abelian Sandpile where the four corner element is n.
For example, n=4
[4 3 2 1 0 1 2 3 4
3 3 2 1 0 1 2 3 3
2 2 2 1 0 1 2 2 2
1 1 1 1 0 1 1 1 1
0 0 0 0 0 0 0 0 0
1 1 1 1 0 1 1 1 1
2 2 2 1 0 1 2 2 2
3 3 2 1 0 1 2 3 3
4 3 2 1 0 1 2 3 4]
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers19
Suggested Problems
-
Select every other element of a vector
36329 Solvers
-
Find the two most distant points
2952 Solvers
-
How to find the position of an element in a vector without using the find function
2814 Solvers
-
Permute diagonal and antidiagonal
504 Solvers
-
448 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!