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

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -