smoothing with Gaussian Kernel for loop problem
이전 댓글 표시
im having a probelm with smoothing the data "ys" using gaussian kernel function everytime i run the for loop i recieve uhat = ys and kerf = 0 0 0 0 0 ... anyone can help me?
ns =length(ys);
nv =length(tv);
lambda = 0.05;
tv = (1:1:1000)';
for i = 1 : ns
k=(tv-tv(i));
kerf=exp(-k.*k/2*(lambda^2))/(sqrt(2*pi)*lambda);
uhat(i)=sum(kerf.*ys(i))/sum(kerf);
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Kernel Distribution에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

