hi I'm using a code along with its function but when I run the code I got error related to the function may someone help me
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
from my code
[EVC,LATENT] = KPCA(X,options);
Ktest = constructKernel(X,X,options);
TKtest = constructKernel(XT,X,options);
from the function
if isfield(options,'Kernel') && options.Kernel
K = data;
else
K = constructKernel(data,[],options);
end
clear data;
but when I run the code I got this
Error in KPCA (line 68)
K = constructKernel(X,options);
Error in myfunction_kernel_pca_kde (line 25)
[EVC,LATENT] = KPCA(X,options);
댓글 수: 11
madhan ravi
2018년 11월 20일
편집: madhan ravi
2018년 11월 20일
can you upload the function and your .dat file
Rui Mauaie
2018년 11월 20일
Rui Mauaie
2018년 11월 20일
Rui Mauaie
2018년 11월 20일
Rui Mauaie
2018년 11월 20일
Stephen23
2018년 11월 20일
Rui Mauaie
2018년 11월 20일
@Rui Mauaie: read the error message:
Undefined function or variable 'constructKernel'.
It states quite clearly that constructKernel is undefined. Why do you think that constructKernel should exist and that MATLAB should be able to find it? Do you expect it to be a function or a variable? If so, where did you save/define it?
Rui Mauaie
2018년 11월 20일
Rui Mauaie
2018년 11월 20일
"so the constructKernel is a part of the function which has relation with my code "
But you did not define constructKernel anywhere in your code. If you do not define it, it does not exist. If it does not exist, you cannot use it. Trying to use it will throw an error.
Here I define a variable X:
X = 3;
Now I can use it:
sin(X)
If I do not define a variable before I use it, this will throw an error:
sin(Y) % do you expect this to work, even though Y is not defined?
If you expect constructKernel to be a function, then where is this function defined? I suspect that you might need to download it, e.g. from FEX:
답변 (0개)
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!