added docstrings to Matlab functions