function in octave code example Example: octave define local function Look into subfunctions: https://octave.org/doc/v4.4.0/Subfunctions.html