implemented data extraction interface to matlab