I was going to comment but I thought my reply might be better an answer. You can preallocate as long as you know apriori what the size you are expecting. If you don't know the size, the allocate in 'reasonable' chunks.
I take it from your code, you are trying to solve Project Euler #4 which ask for the largest palindrome for a product of two 3 digit numbers. So without preallocation generate the first chunk of data by using
a = (999:-1:900)'*(999:-1:900);
which gives you the first 10,000 products of two 3 digit numbers. You can search through these for the largest palindrome.
If you want to continue using loops, just allocate numbers in (100 x 100) blocks till you achieve your result. I think you will find you do not have to go beyond the range I have shown above