Navigation

Operators and Keywords

Function List:

C++ API

: int2str (n)

Convert an integer (or array of integers) to a string (or a character array).

int2str (123)
     ⇒ "123"

s = int2str ([1, 2, 3; 4, 5, 6])
     ⇒ s =
        1  2  3
        4  5  6

whos s
     ⇒
      Attr Name        Size                     Bytes  Class
      ==== ====        ====                     =====  =====
           s           2x7                         14  char

This function is not very flexible. For better control over the results, use sprintf (see ‘Formatted Output’).

Programming Notes:

Non-integers are rounded to integers before display. Only the real part of complex numbers is displayed.

See also: sprintf, num2str, mat2str.

Package: octave