求MATLAB大神帮我看看这段代码哪里错了 索引超出矩阵维度
Y=dlmread('Yale_32x32\StTestFile1.txt');size(Y)a=Y(12,1:end-1);Y=reshape(a,32,32);A=d...
Y=dlmread('Yale_32x32\StTestFile1.txt');
size(Y)
a=Y(12,1:end-1);
Y=reshape(a,32,32);
A=dlmread('Yale_32x32\StTrainFile1.txt');
size(A)
b=A(12,1:end-1);
A=reshape(b,32,32);
c=0;
for i=1:30
Yi=Y(i,1:4096);
D=1000000000;
t=0;
for j=1:135
Zj=A(j,1:4096);
yj=Zj'/(Zj*Zj')*Zj*Yi';
dj=norm(yj-Yi');
if dj<D
D=dj;
t=j;
end
end
if A(t,4097)-Y(i,4097)==0
c=c+1
zq=i
end
end
索引超出矩阵维度。
急求!!!!!!!!!! 展开
size(Y)
a=Y(12,1:end-1);
Y=reshape(a,32,32);
A=dlmread('Yale_32x32\StTrainFile1.txt');
size(A)
b=A(12,1:end-1);
A=reshape(b,32,32);
c=0;
for i=1:30
Yi=Y(i,1:4096);
D=1000000000;
t=0;
for j=1:135
Zj=A(j,1:4096);
yj=Zj'/(Zj*Zj')*Zj*Yi';
dj=norm(yj-Yi');
if dj<D
D=dj;
t=j;
end
end
if A(t,4097)-Y(i,4097)==0
c=c+1
zq=i
end
end
索引超出矩阵维度。
急求!!!!!!!!!! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询