I want to create a cell array with the same prefix + sequential indices, e.g., {'a1','a2','a3','a4','a5'}.
The code below can generate the desired output, but I guess there should be much shorter code can do.
>> strcat('a',arrayfun(@num2str,1:5,'UniformOutput',false))
ans =
1×5 cell array
{'a1'} {'a2'} {'a3'} {'a4'} {'a5'}
It would be greatly appreciated if someone can share ideas to make it in a simpler and more elegant manner.