lambda_target = 1.217e-6; res1_x = 50; # number of points used for contour plot res1_z = 50; res2_x = 20; # number of points used for vector plot res2_z = 20; E = getresult("xy_profile","E"); f = E.f; fi = find(f,c/lambda_target); x = E.x; z = E.z; Ex = pinch(pinch(E.Ex),3,fi); Ez = pinch(pinch(E.Ez),3,fi); x1=linspace(x(1),x(end),res1_x); z1=linspace(z(1),z(end),res1_z); X1 = meshgridx(x1,z1); Z1 = meshgridy(x1,z1); Ex1=interp(Ex,x,z,x1,z1); Ez1=interp(Ez,x,z,x1,z1); x2=linspace(x(1),x(end),res2_x); z2=linspace(z(1),z(end),res2_z); X2 = meshgridx(x2,z2); Z2 = meshgridy(x2,z2); Ex2=interp(Ex,x,z,x2,z2); Ez2=interp(Ez,x,z,x2,z2); matlabsave("field_data",X1,Z1,Ex1,Ez1,X2,Z2,Ex2,Ez2);