k_labels should return 1x1 array with value of zero.
Did you clear workspace from previous runs?
From the documentation on function size
sz = size(A) returns a row vector whose elements are the lengths of the corresponding dimensions of A. For example, if A is a 3-by-4 matrix, then size(A) returns the vector [3 4].
If A is a table or timetable, then size(A) returns a two-element row vector consisting of the number of rows and the number of table variables.