Octave support: replace nested functions

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>