Contents Previous Next Subchapters

Conversion of Numeric Matrix to Character Matrix
Syntax num2str(x)
See Also ntoa

Converts an integer, real, double-precision or complex matrix to a character matrix representation. Each row of the result corresponds to a row of x.

If f is an integer, real, or double-precision scalar and equal to an integer value, it specifies the number of digits of precision in the result. If f is a character row vector, it specifies the format used by sprintf to convert each element of x to a string. The default value for f is three.

If you enter
     x = 1. / (seq(3) * seq(3)')
O-Matrix will reply
     1          0.5          0.333
     0.5        0.25         0.167
     0.333      0.167        0.111