MATLAB: Array of strings from an array of integers

convertint2strintegerMATLABstring

Hi if I have an array of integers like this:
A=[123 456 789]
How do I get an array of strings, say named B, such that:
BB(1) = 123 (this is string 1) BB(2) = 456 (this is string 2) BB(3) = 789 (this is string 3)
What I am trying to do is use integer values as labels for my xtick labels, and cannot figure out how to do it. Thank you.

Best Answer

The output would have to be a cell array
>> BB=arrayfun(@(a)num2str(a),A,'uni',0)
BB =
'123' '456' '789'
>> BB{1}, BB{2}
ans =
123
ans =
456