MATLAB: How do you transform a vector of numbers into a cell of strings

cellmat2cellstringvectorvectorization

I have a vector of numbers:
A = [1 2 3 4 5]';
I want to change it to a cell of strings, such as the one I've declared here:
B = cell(5,1); B{1} = '1'; B{2} = '2'; B{3} = '3'; B{4} = '4'; B{5} = '5';
How can I change A into B without using a for loop?

Best Answer

A = [1:5].'
B = arrayfun(@(x) num2str(x),A,'un',0)