function sortedCluster = orderCluster(vectorToCluster, k, nRow)
Kclima = kmeans(vectorToCluster,k);
zeroVector = zeros(nRow,1);
climaMatrix = [zeroVector vectorToCluster Kclima zeroVector];
for i = 1:nRow
climaMatrix(i,1) = i;
end
[~,idx] = sort(climaMatrix(:,2));
sorted_1_climaMatrix = climaMatrix(idx,:);
ClusterValueToSet = 0;
oldValueCurrentClusterIndex = sorted_1_climaMatrix(i,3);
for i = 1:nRow
currentClusterIndex = sorted_1_climaMatrix(i,3);
if oldValueCurrentClusterIndex ~= currentClusterIndex
ClusterValueToSet = ClusterValueToSet+1;
oldValueCurrentClusterIndex = currentClusterIndex;
end
sorted_1_climaMatrix(i,4) = ClusterValueToSet;
end
[~,idx2] = sort(sorted_1_climaMatrix(:,1));
sorted_2_Cluster = sorted_1_climaMatrix(idx2,:);
sortedCluster = sorted_2_Cluster(:,4);
end
Not enough input arguments.
Error in orderCluster (line 4)
Kclima = kmeans(vectorToCluster,k);