Update MATLAB code to make it a function with input arguments
Update MATLAB code to make it a function with input arguments