Function Reference
— Built-in Function: [status, msg, msgid] = rmdir (dir)
— Built-in Function: [status, msg, msgid] = rmdir (dir, "s")

Remove the directory named dir.

If successful, status is 1, with msg and msgid empty character strings. Otherwise, status is 0, msg contains a system-dependent error message, and msgid contains a unique message identifier.

If the optional second parameter is supplied with value "s", recursively remove all subdirectories as well.