added script to write matlab profile matrices