MATLAB: How to add a string to all member in matrix

matrixstring

Example: I have:
a = [1 2 3; 4 5 6; 7 8 9]
I want have:
b = [s1 s2 s3; s4 s5 s6; s7 s8 s9]

Best Answer

I have the same questions that James Tursa asked, but here is my best guess as to what you want:
b = cellfun(@(x)['s',num2str(x)],num2cell(a),'UniformOutput',false)