int2str - Convert integer to string

Syntax

str = int2str(N)

Description

str = int2str(N) converts an integer to a string with integer format. The input N can be a single integer or a vector or matrix of integers. Noninteger inputs are rounded before conversion.

Examples

int2str(2+3) is the string '5'.

One way to label a plot is

title(['case number ' int2str(n)])

For matrix or vector inputs, int2str returns a string matrix:

int2str(eye(3))

ans =

1  0  0
0  1  0
0  0  1

See Also

fprintf, num2str, sprintf

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS