The format argument is a string containing C language conversion specifications. Sprintf is the same as fprintf except that it returns the data in a MATLAB string variable rather than writing it to a file.
errmsg is an empty matrix if no error occurred.
The sprintf function returns an error message string errmsg if an error occurred. = sprintf(format,A.) formats the data in matrix A (and in any additional matrix arguments) under control of the specified format string, and returns it in the MATLAB string variable s. Sprintf (MATLAB Functions) MATLAB Function Reference