MATLAB: How to fill a cell with matrices without using for-loops

cell arrayfor loop

X = cell{1,10} %Cell filled with matrices sized 101x101
A = cell(a,b); %Cell to be filled with matrices
Permutations = uniqueperms(a,b); %Order in which the new cell needs to be filled
for i=1:a
for j=1:b
A{i,j} = X{Permutations(i,j)};
end
end
For large a and b this obviously takes a long time. Is there a quicker way to get the same output cell A? Thanks in advance

Best Answer

A = X(Permutations);