add script to generate mat file from models