added function to convert vectors to matlab data