added plotting and file dump support to matlab templates