- publishing free software manuals
GNU Octave Manual Version 3
by John W. Eaton, David Bateman, Søren Hauberg
Paperback (6"x9"), 568 pages
ISBN 095461206X
RRP £24.95 ($39.95)

Get a printed copy>>>

11.7.2 Subfunctions

A function file may contain secondary functions called subfunctions. These secondary functions are only visible to the other functions in the same function file. For example, a file ‘f.m’ containing

function f ()
  printf ("in f, calling g\n");
  g ()
function g ()
  printf ("in g, calling h\n");
  h ()
function h ()
  printf ("in h\n")

defines a main function f and two subfunctions. The subfunctions g and h may only be called from the main function f or from the other subfunctions, but not from outside the file ‘f.m’.

ISBN 095461206XGNU Octave Manual Version 3See the print edition