MATLAB: Unrecognized function or variable ‘findNearestNeighbors’. in R2020b

Computer Vision ToolboxMATLABtoolbox

I get an error like this Unrecognized function or variable 'findNearestNeighbors'. while using findNearestNeighbors function. I have Computer Vision Toolbox and UAV toolbox is downloaded and installed. How can I solve this problem ?

Best Answer

findNearestNeighbors is a method of pointCloud objects. You must pass a pointCloud object into it as the first input argument. Both the documentation pages for the method in UAV Toolbox and in Computer Vision Toolbox state that the first input is a "Point cloud, specified as a pointCloud object."
Are you trying to call this method with a pointCloud as the first input or with something else as the first input? I suspect the latter.