Matlab scripts used for COMSOL simulations