view test/nest/recursive_nest.m @ 20530:8c4317b8f7c5 stable

ellipke.m: Use correct definition of elliptic integral in documentation (bug #45522). * ellipke.m: Replace 'm^2' with just 'm' in definitions of elliptic integrals.
author Rik <rik@octave.org>
date Fri, 10 Jul 2015 11:55:14 -0700
parents be18c9e359bf
children
line wrap: on
line source

# recursive_nest.m
function x = recursive_nest ()
  global recursive_nest_inc = 1
  x = 5;
  f (20);

  function f (n)
    if n > 0
      x = x + recursive_nest_inc;
      f (n - 1);
    end
  endfunction
endfunction