Here is an example MATLAB code to simulate a single pulse laser using the Optical Toolbox:
main.m732 chars28 lines
This code defines the laser parameters such as the wavelength, pulse duration, pulse energy, and time step. It then creates a time axis and defines the pulse envelope using a Gaussian function. The envelope is normalized to ensure that the pulse energy matches the desired value.
A GaussianBeam object is created to represent the laser beam. The Propagate
method is called to simulate the propagation of the pulse through free space. Finally, the pulse is plotted to visualize the results.
gistlibby LogSnag