• Remix
  • Share
  • New Entry

on 29 Oct 2021
  • 4
  • 14
  • 0
  • 0
  • 205
% Learn more here: https://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile
a = zeros(141);
a(70,70)=3e4;
m = int8([0 1 0;1 -4 1;0 1 0]);
while nnz(a>3)
a = a + filter2(m,a>3,'same');
end
h = imagesc(a);
cmap = [ ...
3 65 251
120 164 230
255 229 0
158 0 0
] / 255;
colormap(cmap)
axis equal off
Remix Tree