Index exceeds matrix dimensions程序维数为什么错了
function [ Qhj,Qh,prey]=crossval7(X,Y)%px是自变量的个数;
%py是因变量的个数;
=fun1(X,Y);
PRESShj=zeros(px,py);
c=norm1(C);
X=c(:,1:px);
Y=c(:,px+1:px+py);
x=norm1(X);
y=norm1(Y);
=size(x);
for h=1:px
for j=1:line
newx=X;
newy=Y;
newx(j,:)=[];
newy(j,:)=[];
=fun717(px,py,);
prey(j,:,h)=X(j,:)*FF(:,2:px+1,h)'+FF(:,1,h)';
end
PRESShj(h,:)=sum((Y-prey(:,:,h)).^2);
end
PRESSh=(sum(PRESShj'))';
for h=1:px
=fun717(px,py,c);
prey2(:,:,h)=X(:,:)*FF(:,2:px+1,h)'+ones(line,1)*FF(:,1,h)';
SShj(h,:)=sum((Y-prey2(:,:,h)).^2);
end
SSh(h,1)=(sum(SShj'))';
Qhj=ones(px-1,py)-PRESShj(2:px,:)./SShj(1:px-1,:); % 错位
Qh=ones(px-1,1)-PRESSh(2:px,1)./SSh(1:px-1,1); 这里错了
??? Index exceeds matrix dimensions.
Error in ==> crossval7 at 33
Qh=ones(px-1,1)-PRESSh(2:px,1)./SSh(1:px-1,1);
[ 本帖最后由 ChaChing 于 2009-4-29 21:49 编辑 ] 检查一下PRESSh和SSh的长度是不是小于px :handshake 我试试去
页:
[1]