num2str
Convert a number to a string.
Syntax
Section titled “Syntax”str = num2str(A)str = num2str(A, precision)str = num2str(A, format)Description
Section titled “Description”Returns a string representation of the number(s) in A. With a numeric precision, controls the number of significant digits. With a string format (a sprintf-style format spec like '%6.2f'), uses that exact format.
Examples
Section titled “Examples”num2str(pi) % '3.1416'num2str(pi, 10) % '3.141592654'num2str(pi, '%8.4f') % ' 3.1416'