MATLAB: How to make string from matrix

martixstring

Hello everyone.. Can anoyne help me with this.. I have matrix with dimension 662×2 for example
y=[111 20;123 43;117 89;....] on so on
and form that matrix I need to make string but in every new row to put '#' so matrix y should be converted in string like this
yy='111 20#123 43#117 89#..' and so on
Thank you!

Best Answer

A=magic(4)
B=[num2cell(A');repmat({'#'},1,size(A,1))]
out=strjoin(cellfun(@num2str,B(:)','un',0))