twokpca.m
上传用户:nxf103
上传日期:2017-12-04
资源大小:2690k
文件大小:0k
开发平台:

Matlab

  1. function a=twokpca(test,train,i,p,new)
  2. n1=size(train,1);
  3. a=0;
  4. for j=1:n1
  5.     a=a+(((train(j,i)-test(new,i))^2+(train(p,i)-test(new,i))^2)*onekpca(train(j,:),test(new,:))*onekpca(train(p,:),test(new,:)));
  6. end
  7. a=(1/n1)*a;