MATLAB Language Using functions with logical output