def find_matlab_root():
matlab_root = None<EOL>path_dirs = os.environ.get("<STR_LIT>").split(os.pathsep)<EOL>for path_dir in path_dirs:<EOL><INDENT>candidate = realpath(join(path_dir, '<STR_LIT>'))<EOL>if isfile(candidate) or isfile(candidate + '<STR_LIT>'):<EOL><INDENT>matlab_root = dirname(dirname(candidate))<EOL>break<EOL><DEDENT><DEDENT>return matlab_root<EOL>
Look for matlab binary and return root directory of MATLAB
    installation.