Updates to export data to matlab