0
votes

I have some data stored in a mat file spreadsheet when i try to run my kmeans.m script I get this error and I cant work out whats going on?

Attempt to execute SCRIPT kmeans as a function    
Error in ==> kmeans at 10
    [clustIDX, clusters, interClustSum, Dist] = kmeans(data,
    K, 'options',opts, ...
1
Could you please list the full error? - Jonas
that is the full error? ??? Attempt to execute SCRIPT kmeans as a function? - G Gr
do you also have a script called kmeans.m in your MATLAB path? - abcd
hey yoda yes i do? (sorry for those that dont know ive been using matlab for about 4 days) - G Gr
try renaming that script to something else. kmeans is a toolbox function that you're trying to use. If you also name your script as kmeans.m, then that has precedence in MATLAB's search and it calls it instead of the function you actually want, which causes the error you're seeing. - abcd

1 Answers

1
votes

Try renaming your script to something else. kmeans is a toolbox function that you're trying to use. If you also name your script as kmeans.m, then that has precedence in MATLAB's search and it calls it instead of the function that you actually want, which causes the error you're seeing.