Convert integers to characters
chr = int2str(N)
example
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.
N
int2str
collapse all
Convert an integer.
chr = int2str(256)
chr = '256'
Round off a floating-point value and convert it.
chr = int2str(3.14159)
chr = '3'
Convert a numeric matrix.
chr = int2str([5 10 20;100 200 400])
chr = 2x13 char array ' 5 10 20' '100 200 400'
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.
string
Usage notes and limitations:
Input array must be scalar at compile time.
This function accepts GPU arrays, but does not run on a GPU.
For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
cast | mat2str | num2str | sprintf | str2double | str2num | string
cast
mat2str
num2str
sprintf
str2double
str2num
You have a modified version of this example. Do you want to open this example with your edits?