Testing functionality in MATLAB