MATLAB script containing a calculation function used by the main scripts.