reorganised analysis.m, put parts of code into subscripts coilR.m and vary_B.m