Create md_checkdir.m

Simple function that checks the validity of a path.