A socket interface for passing data between matlab and an external program