MATLAB: How to remove a specific number of elements from a cell array and place them into another cell array

cell arraysindexing

If I have, for example…
a = [1 , 2 ,3 ,4] and b = {'a','b','c','d','e','f','g','h','i','j'}
how can I remove the number of elements in b that correspond to the value in a and place them into new cell arrays?
I want to get the new cell arrays…
A1 = {'a'}
A2 = {'b','c'}
A3 = {'d','e','f'}
A4 = {'g','h','i','j'}
a and b do not matter after this is done.
Thank you.

Best Answer

Don't think of dynamically naming variables use cells instead:
A=mat2cell(b,1,[1 2 3 4]);
celldisp(A)