简体   繁体   中英

Matlab Error: Undefined function 'knnclassify' for input arguments of type 'double'

I am trying to do knnclassify on test_data(10000X784) , train_data(50000X784) , train_label(50000X1) and k = 1

And I am calling this function as follows:

label = knnclassify(test_data,train_data,train_label,k);

Background:
Where train_label is numeric equivalent digit of the data given in train_data . I want to classify my test_data . The data in both the train and test are in random order, but the train_label totally corresponds with the data in the train_data .

In my friend's workstation it works fine, but in my laptop it gives this error:

Undefined function 'knnclassify' for input arguments of type 'double'.

What could be the reason for the issue and how to solve it? Do I need to install any package? If yes how?

This error means that the function cannot be found in matlab, so you might missing the required toolbox. Just as @schorsch said you need to install the Bioinformatics toolbox.

A way to find out if the function is available in Matlab is typing which knnclassify . The output will be the route where the function resides or 'knnclassify' not found. otherwise.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM