MATLAB: Make header from numeric array

column header

Hi,
I have a numeric array and want to concatenate each element with a string. As I will use the new array as a header, it needs to end up as a cell array.
i am trying:
wl_arr = 400:1.85:2400;
hdr = strcat('L_conv_', num2cell(wl_arr));
but get this:
I also tried:
wl_arr_str = num2str(wl_arr);
rad_conv_hdr1 = strcat('L_conv_', wl_arr_str);

Best Answer

hdr = arrayfun(@(x) sprintf('L_conv_%f', x), wl_arr, 'unif', 0)