Yes, it is a version issue. Starting in R2016b, MATLAB does implicit expansion as needed.
With your GLCM matrix being 32 x 32 x 4, then sum(GLCM) is 1 x 32 x 4, and sum() of that is 1 x 1 x 4. You have GLCM ./ that, so you have a 32 x 32 x 4 matrix, ./ a 1 x 1 x 4 matrix.
This is element-wise division between two matrices that are not scalar and are not the same size, because [32 32 4] ~= [1 1 4] .
In R2016a and earlier, element-wise binary operations between matrices that are different size is an error unless one of them is a scalar.
In R2016b and later, MATLAB compares the dimensions that are not equal and checks to see if they are 1 in one of the matrix and not 1 in the other. If that is the case for all of the dimensions that do not match, then MATLAB now replicates the data to match the dimension of the other item. In this case, the 1 x 1 x 4 matrix would be effectively repmat(matrix, [32 32 1]) making it 32 x 32 x 4 which could then be processed through the ./ operator.
R2016a and earlier can do this kind of replication, but you have to know to ask for it, either using repmat() or using bsxfun():
bsxfun(@rdivide, GLCM, sum(sum(GLCM)))