stream = RandStream('mlfg6331_64');  % stream nahodnych cisel pro generovani seeds
options = statset('UseParallel',1,'UseSubstreams',1,'Streams',stream); 
tic; % Start stopwatch timer
[idx,C,sumd,D] = kmeans(Data_shluk(:,2:21),eva.OptimalK,'Options',options,'MaxIter',10000,...
    'Display','final','Replicates',100,'Distance',met_vzdal(ix_met));
toc
Starting parallel pool (parpool) using the 'local' profile ...
Connected to the parallel pool (number of workers: 2).
Replicate 3, 3 iterations, total sum of distances = 64.7022.
Replicate 2, 3 iterations, total sum of distances = 65.8513.
Replicate 1, 3 iterations, total sum of distances = 65.0769.
Replicate 6, 3 iterations, total sum of distances = 67.9301.
Replicate 30, 3 iterations, total sum of distances = 64.9966.
Replicate 29, 3 iterations, total sum of distances = 65.5597.
Replicate 28, 2 iterations, total sum of distances = 66.1061.
Replicate 27, 2 iterations, total sum of distances = 70.9008.
Replicate 26, 2 iterations, total sum of distances = 65.0638.
Replicate 25, 3 iterations, total sum of distances = 66.7275.
Replicate 24, 2 iterations, total sum of distances = 67.4425.
Replicate 23, 4 iterations, total sum of distances = 66.5222.
Replicate 22, 2 iterations, total sum of distances = 73.4667.
Replicate 21, 6 iterations, total sum of distances = 67.7962.
Replicate 20, 2 iterations, total sum of distances = 67.1666.
Replicate 19, 4 iterations, total sum of distances = 67.4698.
Replicate 18, 2 iterations, total sum of distances = 67.9803.
Replicate 17, 2 iterations, total sum of distances = 68.0325.
Replicate 16, 3 iterations, total sum of distances = 64.1965.
Replicate 15, 3 iterations, total sum of distances = 65.8722.
Replicate 14, 3 iterations, total sum of distances = 66.9342.
Replicate 13, 2 iterations, total sum of distances = 64.8863.
Replicate 12, 3 iterations, total sum of distances = 67.6685.
Replicate 11, 3 iterations, total sum of distances = 65.2215.
Replicate 10, 3 iterations, total sum of distances = 65.5152.
Replicate 9, 3 iterations, total sum of distances = 65.7642.
Replicate 8, 2 iterations, total sum of distances = 69.0841.
Replicate 7, 4 iterations, total sum of distances = 66.9721.
Replicate 66, 5 iterations, total sum of distances = 67.5973.
Replicate 65, 4 iterations, total sum of distances = 68.3341.
Replicate 64, 2 iterations, total sum of distances = 69.813.
Replicate 63, 2 iterations, total sum of distances = 66.3769.
Replicate 62, 1 iterations, total sum of distances = 68.5254.
Replicate 61, 5 iterations, total sum of distances = 65.8949.
Replicate 60, 3 iterations, total sum of distances = 67.9343.
Replicate 59, 2 iterations, total sum of distances = 71.1015.
Replicate 58, 3 iterations, total sum of distances = 68.477.
Replicate 57, 4 iterations, total sum of distances = 65.4592.
Replicate 56, 4 iterations, total sum of distances = 65.8331.
Replicate 55, 2 iterations, total sum of distances = 69.0119.
Replicate 84, 2 iterations, total sum of distances = 67.1205.
Replicate 83, 3 iterations, total sum of distances = 64.2394.
Replicate 82, 2 iterations, total sum of distances = 67.9803.
Replicate 81, 3 iterations, total sum of distances = 70.2495.
Replicate 80, 3 iterations, total sum of distances = 65.4769.
Replicate 79, 2 iterations, total sum of distances = 71.2304.
Replicate 93, 6 iterations, total sum of distances = 64.7765.
Replicate 92, 7 iterations, total sum of distances = 65.0259.
Replicate 91, 2 iterations, total sum of distances = 64.8357.
Replicate 98, 3 iterations, total sum of distances = 68.1225.
Replicate 97, 2 iterations, total sum of distances = 66.0429.
Replicate 5, 3 iterations, total sum of distances = 65.7533.
Replicate 4, 4 iterations, total sum of distances = 66.5048.
Replicate 54, 4 iterations, total sum of distances = 68.2935.
Replicate 53, 5 iterations, total sum of distances = 67.8655.
Replicate 52, 3 iterations, total sum of distances = 66.2345.
Replicate 51, 2 iterations, total sum of distances = 67.1399.
Replicate 50, 6 iterations, total sum of distances = 70.4007.
Replicate 49, 2 iterations, total sum of distances = 65.751.
Replicate 48, 3 iterations, total sum of distances = 65.0418.
Replicate 47, 2 iterations, total sum of distances = 64.1965.
Replicate 46, 3 iterations, total sum of distances = 65.432.
Replicate 45, 3 iterations, total sum of distances = 68.1851.
Replicate 44, 2 iterations, total sum of distances = 66.3945.
Replicate 43, 3 iterations, total sum of distances = 64.6998.
Replicate 42, 3 iterations, total sum of distances = 67.4994.
Replicate 41, 3 iterations, total sum of distances = 71.2691.
Replicate 40, 4 iterations, total sum of distances = 67.6499.
Replicate 39, 4 iterations, total sum of distances = 66.3151.
Replicate 38, 3 iterations, total sum of distances = 72.0469.
Replicate 37, 2 iterations, total sum of distances = 67.4223.
Replicate 36, 2 iterations, total sum of distances = 64.2394.
Replicate 35, 2 iterations, total sum of distances = 72.983.
Replicate 34, 2 iterations, total sum of distances = 66.2041.
Replicate 33, 4 iterations, total sum of distances = 67.1191.
Replicate 32, 3 iterations, total sum of distances = 64.2394.
Replicate 31, 6 iterations, total sum of distances = 66.3042.
Replicate 78, 3 iterations, total sum of distances = 68.2921.
Replicate 77, 2 iterations, total sum of distances = 67.9765.
Replicate 76, 3 iterations, total sum of distances = 69.131.
Replicate 75, 8 iterations, total sum of distances = 66.7147.
Replicate 74, 2 iterations, total sum of distances = 65.8683.
Replicate 73, 4 iterations, total sum of distances = 68.3483.
Replicate 72, 5 iterations, total sum of distances = 66.9054.
Replicate 71, 2 iterations, total sum of distances = 66.3339.
Replicate 70, 2 iterations, total sum of distances = 64.1965.
Replicate 69, 2 iterations, total sum of distances = 67.9803.
Replicate 68, 5 iterations, total sum of distances = 64.7765.
Replicate 67, 2 iterations, total sum of distances = 65.0314.
Replicate 90, 2 iterations, total sum of distances = 67.9217.
Replicate 89, 5 iterations, total sum of distances = 67.9343.
Replicate 88, 4 iterations, total sum of distances = 64.2634.
Replicate 87, 4 iterations, total sum of distances = 64.7022.
Replicate 86, 3 iterations, total sum of distances = 67.2596.
Replicate 85, 4 iterations, total sum of distances = 66.5079.
Replicate 96, 3 iterations, total sum of distances = 65.0418.
Replicate 95, 3 iterations, total sum of distances = 65.2873.
Replicate 94, 3 iterations, total sum of distances = 65.1995.
Replicate 100, 8 iterations, total sum of distances = 65.2508.
Replicate 99, 2 iterations, total sum of distances = 69.6657.
Best total sum of distances = 64.1965
Elapsed time is 58.165379 seconds.