executing of function don't works

When i execute function I = nearestneighbour(P, X) ;X = rand(2, 100); P = rand(2, 3);i have this mistake : Undefined function 'nearestneighbour' for input arguments of type 'double'.

Answers (1)

You are trying to use a function that does not exist. Like this:
>> this_does_not_exist(5,7)
Undefined function 'this_does_not_exist' for input arguments of type 'double'.
When I searched the entire MATALB documentation for "nearestneighbour" it returned no results:
So an error message "Undefined function" means that that function is undefined. You need to do one of these:
  • write that function yourself.
  • download it from a third party source (perhaps you meant to use this FEX submssion?: nearestneighbour).
  • if you already have the file make sure that it is on the MATLAB path.

2 Comments

tek chimel
tek chimel on 29 Feb 2016
Edited: Stephen23 on 29 Feb 2016
Thanks But what is the MATLAB path where i save my nearestneighbour.m file? I have nearestneighbour.m that i saved in Mes Documents repersory
Use the folder tree in the Current folder panel to browse to the "Mes Documents repersory" folder where you have the file saved. That will set the current folder to that folder and it will then be able to find it.

Sign in to comment.

Categories

Find more on MATLAB Coder in Help Center and File Exchange

Asked:

on 29 Feb 2016

Edited:

on 29 Feb 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!