matlab: fixed -outdir support

fix for issue #1