MATLAB: Kmeans is suddenly behaving differently

kmeansStatistics and Machine Learning Toolbox

Dear Matlab-Community,
just a few days ago I built a skript that required clustering and used the function kmeans(Data,Clusters,Options) and it worked straight away and I got good results with the following settings, analog to a setup from the examples:
opts = statset('Display','final');
[idx1, C1] = kmeans(2,datZ,'Distance','sqeuclidean','Replicates',5,'Options',opts);
Today, if I run the same script I get: Error using kmeans Too many input arguments."
The help for kmeans also returns a different function (?!) now:
kmeans Trains a k means cluster model.
Description
CENTRES = kmeans(CENTRES, DATA, OPTIONS) uses the batch K-means
algorithm to set the centres of a cluster model. The matrix DATA
represents the data which is being clustered, with each row
corresponding to a vector. The sum of squares error function is used.
The point at which a local minimum is achieved is returned as
CENTRES. The error value at that point is returned in OPTIONS(8).
Did the function get updated and change its functionality? Does anyone know what is going on?
If I then try to adapt to the suggestion from the help I get:
Error using kmeans (line 46)
Data dimension does not match dimension of
centres
/Update: This only occurs in R2017a and not in R2016b! kmeans works like expecter kmeans(Data,Clusters,…) like expected. The Bug/Issue is only found in R2017a.

Best Answer

This means that you have installed the FEX: NETLAB toolbox written by Ian T. Nabney, which contains a kmeans function also. Obviously it was inserted on top of the Matlab path, such that builtin functions are shadowed. You can check this by:
which kmeans -all