A conversion specification controls the notation, alignment, significant digits, field width, and other aspects of output format.
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 (MATLAB Functions) MATLAB Function Referenceįormats 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.