In matlab run PlotFig2_3.m in order to plot the figures 2 and 3. Parameters in this code can be generated using Fig3_Data.m. Sim__e_a__e_r.m is used in Fig3_Data.m to calculate table 1. All other functions are utilised by the main codes to perform fitting or plotting. The raw datafiles have the format [Z position of stage (mm) Vsm (mV)].