You can buy stock X, then sell stock X the same day (say Monday). You can then (on the same day) buy stock Z. You run into a problem when you try and sell Stock Z. The reason being is that you bought stock Z with the unsettled funds from the sale of stock X. You can sell stock Z about 3 days later (thursday).
-The same applies if you wanted to buy back into stock X, you just can't sell it again for three days or after the transaction from original sale settles.