Automatically create the regions file for Matlab

gooby pls