The speedup isn't always linear with more cores, but setting maxNumCompThreads to 8 should definitely help. Your computer specs look decent so they shouldn't really pose a problem unless your program is quite large.
If you create a separate thread here and post your code we can also help you optimize that.
The reason this slows down execution is that your computer constantly has to reallocate memory as the array gets larger. Compare this to a dinner party reservation. If you make a reservation for 5 people, then shortly after dinner starts a 6th person shows up, the restaurant has to accommodate them. Then a 7th shows up. Then an 8th, and a 9th. Soon the restaurant needs a bigger table for the party of 9, and they really would have appreciated that information up front!
But seriously, the way to avoid this is by preallocating the vector to its final size. So if, after the loop, the vector is 1x100, then all you need to do is make a 1x100 vector of zeros before the loop. Then the loop changes the values already present in the vector instead of changing the size. With the previous example, this is like making a reservation for 5 people, then 3 people cancel and 3 different people show up, but the total remains 5. The restaurant could care less in this case since the reservation was accurate. With MATLAB, it's computationally cheaper to change an existing value in an array than to constantly reevaluate how big the array needs to be.
That said, it's possible you can eliminate the loop entirely and just do operations on vectors.
Hope this helps