"cpslopecal_Boss.m" is the code as it appears in the Lab 5 handout. It generates an error because the function "least_square_cp" is defined within a script. "cpslopecal_Boss_function.m" is the driver part of the code only, defined as a function. It calls least_square_cp.m. Put both files in your Matlab path and run cpslopecal_Boss_function" to calculate the beam-c slope (replace example data with your own!)