added matlab wrapping functions