Explanation

If the first input argument to the warning function is the identifier property of the MException class, then the second input argument is interpreted as unformatted text. Any slashes are treated as escape characters which is likely not intended.


Suggested Action

When using the message property of an MException object as the warning message, add the string format specifier to the warning function call.  For example, create the following MException object.

E = MException('myComponent:myID','%s',pwd);

To correctly display the message, call the warning function as follows:

warning(E.identifier,'%s',E.message)

If you call the warning function without the specifier, MATLAB interprets the slashes in the current folder path as escape characters.