The good thing about reshape is IF you put in an empty argument, then it figures out how many columns you will need.
But first, reshape will fail here, if the number of elements in your array is not an integer mutiple of 339.
So the desired reshape will not fail.
However, you need not compute the number of columns yourself.
So the use of empty brackets tells reshape to figure out how many columns would have been necessary.
Finally, this even works to turn the matrix into a 3-dimensional matrix.
A = rand(23043864,3);
B = reshape(A,339,,3);
339 67976 3
As you should see, I never needed to compute the number of columns. Let reshape do the thinking for you.