towards implementing input/output in mexfunction