fixed rng seeding to work for both Octave and MATLAB