You can try following code block to check if the directory is having Write Access. It checks FileSystemAccessRule.
Click the message indicator to go to next code fragment containing a message. The next code fragment is relative to the current cursor position, viewable in the status bar.To go to the next message, click the message indicator or the next underlined code fragment.
The comment appears at the end of the line, which instructs MATLAB not to check for a terminating semicolon throughout the file. All underlines and marks in the message indicator that correspond to this message disappear.
Exception handlers don’t just handle exceptions if they occur immediately in the try clause, but also if they occur functions that are called (even indirectly) in the try clause. For example:
The stored procedure uspPrintError prints information about the error that caused execution to transfer to the CATCH block of TRY…CATCH construct. uspPrintErrorshould be executed in the scope of a CATCH block otherwise, the procedure returns without printing any error information. The following example shows the code for .ERROR_SEVERITY() returns the error severity.