MATLAB: Insert a string section on the numbers in a vector

koojo

A = [ 2 7 9 13];
add text CH_ on each value in the vector A
output
B = [CH_2 CH_7 CH_9 CH_13]

Best Answer

res = arrayfun(@(x)strcat('CH_', num2str(x)), A, 'UniformOutput', false);
res{1}, res{2} % to get each element