Can anyone help me to apply RBF kernel function in matlab and how to write its equation?
조회 수: 15 (최근 30일)
이전 댓글 표시
The equation is K(X,X') = exp(-||X-X'||2/2sigma2). Any help is appreciated
댓글 수: 0
채택된 답변
the cyclist
2021년 5월 10일
편집: the cyclist
2021년 5월 10일
% Define sigma
sigma = 0.4;
% Define the function
K = @(x1,x2) exp(-sum((x1-x2).^2)./(2.*sigma.^2));
% Apply the function to two vectors
K([1; 2; 3],[1; 2; 4])
(I think I got the norm part coded right, but you should double-check that because I didn't.)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!