matlab - Strcat cell array and array -
i have cell array strings , numeric array in matlab. want every entry of cell array concatenated number corresponding position of array. think can solved using cellfun, failed work.
to clarify, here example:
c = {'121' '324' '456' '453' '321'}; array = 1:5 i get:
c = {'1121' '2324' '3456' '4453' '5321'}
a special version of sprintf outputs directly cell array called sprintfc:
>> c = sprintfc('%d%d',[array(:) str2double(c(:))]).' c = '1121' '2324' '3456' '4453' '5321' it bit different in way handles array inputs, preserving shape.
Comments
Post a Comment