This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Convert integers to characters


chr = int2str(N)



chr = int2str(N) treats N as a matrix of integers and converts it to a character array that represents the integers. If N contains floating-point values, int2str rounds them before conversion.


collapse all

Convert an integer.

chr = int2str(256)
chr = 

Round off a floating-point value and convert it.

chr = int2str(3.14159)
chr = 

Convert a numeric matrix.

chr = int2str([5 10 20;100 200 400])
chr = 2x13 char array
    '  5   10   20'
    '100  200  400'

Input Arguments

collapse all

Input array, specified as a numeric matrix.


  • int2str returns character arrays only. Starting in R2016b, you can convert numeric arrays to string arrays using the string function.

Extended Capabilities

Introduced before R2006a

Was this topic helpful?