It is a function that creates Jonswap/Pierson-Moskowitz spectrum and a wave based on that. This file also has two examples: example.m and Drawing_both_spectrum.m. The first one shows how to use the code and the second one shows the difference between Jonswap and Pierson-Moskowitz spectrums.
Please refer to section 2.3.1 of the following dissertation: S. M. Vazirizade, “An Intelligent Integrated Method for Reliability Estimation of Offshore Structures Wave Loading Applied in Time Domain,” The University of Arizona., 2019. Link 1: https://repository.arizona.edu/bitstream/handle/10150/636592/azu_etd_17617_sip1_m.pdf?sequence=1