MATLAB: How to convert each row of the matrix into a Character array, without using a for command

the usage of char

Matlab code:
A=rand(1e3,2);%just an example
for i=1:size(A,1)
B{i}=num2str(A(i,:));
end
Question: The cost time of the code is related to the size of A. How can I get the B without the For command and spend as less time as possible?

Best Answer

Preallocate B may help just tad...
Alternatives to loop include
B=cellstr(num2str(A));
but what is end purpose for doing the conversion? Perhaps could avoid entirely??? The most time-saving optimization is the one that avoids doing the unneeded... :)