Michael, I do not have Matlab handy, but I think it has exist() function. and so does Octave. Therefore, you can try something like: ... if exist("OCTAVE_VERSION") system(...); else eval(...); end; Andrey