Undefined function or variable

조회 수: 1 (최근 30일)
danielle sisserman
danielle sisserman 2020년 11월 7일
댓글: danielle sisserman 2020년 11월 7일
I am getting the following error:
this is the function call:
k_distances,k_indices = findKNN(classifier,Xtest(i:1,:));
and this is the first line of the function definition:
function [k_distances,k_indices] = findKNN(classifier,x_test)
can anybody see what I did wrong here?
Thank you

채택된 답변

John D'Errico
John D'Errico 2020년 11월 7일
편집: John D'Errico 2020년 11월 7일
When you want to return results from a function, if there are more then ONE output, use square brackets.
[k_distances,k_indices] = findKNN(classifier,Xtest(i:1,:));
Just like the function header.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by