Added octave support

I don't have Matlab, so you should test that the modifications don't brake anything there (they "should not", though).