MATLAB code is to process the raw data measured by Ocean spectrometer. The main purpose of code is to remove the significant background in the spectra due to the straylight. The measured spectral intensities measured before and after cut are input file to be read by MATLAB. Integration time and fiber lengths are needed to generate the corresponding attenuation curves. In the operation, the UV bandedge are required to manually identify on the screen by hand. By clicking the cursor, the X position will be automatically recorded and the local wavelength be recognized as the edge of band. The clicking point should not be at the sharp transitions of band but offset.