In reply to Ksharp.

Thanks for the alternative. You can speed up your program by eliminating the unnecessary call to REPEAT. Just use
temp=A[i,];