added MATLAB/OCTAVE code