1# persistent_nest
2function y = persistent_nest ()
3  persistent x = 0;
4  g;
5  y = x;
6
7  function g
8    x = x + 1;
9  end
10end
11