
lambda=1e-6;

gcnew=FT_init_gauss_coefficients('LGcos',9);
gcnew=FT_set_mode_coefficient(gcnew,sqrt(0.80),3,3);
gcnew=FT_set_mode_coefficient(gcnew,sqrt(0.2),2,1);

gc2=FT_init_gauss_coefficients('LGcos',9);
gc2=FT_set_mode_coefficient(gc2,sqrt(1),3,3);


pixel=20e-6;

gp=FT_init_gauss_param(lambda,1,'w0',50*20e-6,'z',0);

x=linspace(1,512,512)*pixel;
y=linspace(1,512,512)*pixel;

field=FT_mode_coefficients_to_field(gcnew,gp,x,y,[512/2,512/2,0]*pixel,0);
intensity=abs(field).^2;
nnn=max(max(intensity));

 imwrite(intensity/nnn,'test.png','PNG');
 
 field2=FT_mode_coefficients_to_field(gc2,gp,x,y,[512/2,512/2,0]*pixel,0);