TAG: a matlab program example