This MATLAB code simulates the propagation of a Gaussian beam through free space and its interaction with a lens at various distances. The code provides insights into the intensity profiles at different planes along the propagation path.