m-files for flux analysis (version 1)