Unrecognized function or variable 'knnimpute'

조회 수: 3 (최근 30일)
Alexander
Alexander 2023년 12월 1일
댓글: Star Strider 2023년 12월 1일
I have the stats and ml toolboxes installed, as well as the bioinformatics toolbox as well. If I try to run the function on an incomplete matrix I get the error in the title.
data = [2 3 3; NaN 5 4; 4 2 NaN];
knnimpute(data)
How do I go about debugging this? I'm not familiear with matlab toolboxes, so I wasn't sure if they get automatically added to path or not.
OS is Arch running XFCE4, matlab release 2023b though that's probably not necessary information. Will update
  댓글 수: 2
Dyuman Joshi
Dyuman Joshi 2023년 12월 1일
Please show the output of
which knnimpute -all
Alexander
Alexander 2023년 12월 1일
It is not found

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2023년 12월 1일
If you installed the Toolboxes using the installer, MATLAB should be able to access them.
Your posted code works here —
data = [2 3 3; NaN 5 4; 4 2 NaN];
knnimpute(data)
ans = 3×3
2.0000 3.0000 3.0000 4.5000 5.0000 4.0000 4.0000 2.0000 2.0000
You may have a path problem.
Run these from a script or your Command Window:
restoredefaultpath
rehash toolboxcache
then see if it solves the problem. If it does not, then Contact Support.
.
  댓글 수: 2
Alexander
Alexander 2023년 12월 1일
This worked, I suspected it was a path issue but didn't know how to reset it. Thank you
Star Strider
Star Strider 2023년 12월 1일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by