adding unit tests by matlab/octave script, so we can compare the result with native code.