# K-means related question

I am a new user to Matlab kmeans and have the following question:

I would like to use the following call from a Python application which is listed in this URL.

[idx, C] = kmeans(data, k)


Question 1: Do I need to allocate idx and C before this call to kmeans() or should I call the function without pre-allocation?

idx = []
C = [][]

[idx, C] = kmeans(data, k)


Question 2: After the call, can I manipulate idx array as well as C array independently?

In closing my source of confusion is [idx, C] implies one multi-dimensional array but dimensions of idx is "nx1" where n is the number of data points while dimension of C is two dimensional array [kX2]?