helper to export samples to matlab