A = A .* permute(eye(size(A, 2), [3 1 2]))
Note that it's a bit odd to stack your matrices along the first dimension. You'd be better off stacking along the third dimension which would remove the need for the squeeze in your loop, and the need for the permute in the above.
I.e. you'd be better off storing A as: