Matlab code for flat dark correction