General functions that are available for general use by Campbell lab MATLAB code