I would use randperm
to generate randomly ordered indexes
rand_ind=randperm(length(Q));
and then use the random indexes to generate the randomly permuted cell arrays
Q_random=Q(rand_ind);
A_random=A(rand_ind);
This answer to a previous related question may also be worth looking at.