new TC matlab codes