DATAFUNC.m: basic functions to manipulate data