2. Then define the amplitude a and laser radius w of Gaussian laser, and use the formula f of Gaussian function equal to AEXP (-(x 2+y 2)/(w 2)) to create the mode of Gaussian laser.
3. Next, calculate the energy. In order to calculate the energy of Gaussian laser, it is necessary to integrate F in space coordinates. In Matlab, integral2 function can be used to calculate two-dimensional integral.