Ayu
2008-03-10, 09:13
M=load('hemo.mat')
P= M.hemo
HR= find(P(:,24)>=15);
NHR= find(P(:,24)<15);
A= P(HR,1);
B= P(NHR,1);
X= size(A)
Y= size(B)
F1=0;
for i=1:71
P= M.hemo
P(i,:)=[];
HR1= find(P(:,24)>=15);
NHR1= find(P(:,24)<15);
A= P(HR1,1);
B= P(NHR1,1);
[rf,rxi]= ksdensity(A)
[nrf, nrxi]= ksdensity(B)
S1= sign(rf(7)-nrf(7)); % assign x axis from 1 to 100, and we start to look for threshold from the 7th value. Because the first ones are both 0, that’s not what we want.
for j = 1:100
S2=sign(rf(j)-nrf(j));
if S1~=S2
disp(j); % the index of the threshold
break;
end
end
threshold=nrf(j)
U=P(i,1)
if U>threshold
RP= 1;
F1=F1+1;
else
RP=0;
end
disp('F1=');
disp(F1)
end
其中M是一个72×24的矩阵。
为什么每次运行后会显示
??? Error using ==> mrdivide
Matrix dimensions must agree.
的错误信息呢?
哪位高手帮忙啊!
P= M.hemo
HR= find(P(:,24)>=15);
NHR= find(P(:,24)<15);
A= P(HR,1);
B= P(NHR,1);
X= size(A)
Y= size(B)
F1=0;
for i=1:71
P= M.hemo
P(i,:)=[];
HR1= find(P(:,24)>=15);
NHR1= find(P(:,24)<15);
A= P(HR1,1);
B= P(NHR1,1);
[rf,rxi]= ksdensity(A)
[nrf, nrxi]= ksdensity(B)
S1= sign(rf(7)-nrf(7)); % assign x axis from 1 to 100, and we start to look for threshold from the 7th value. Because the first ones are both 0, that’s not what we want.
for j = 1:100
S2=sign(rf(j)-nrf(j));
if S1~=S2
disp(j); % the index of the threshold
break;
end
end
threshold=nrf(j)
U=P(i,1)
if U>threshold
RP= 1;
F1=F1+1;
else
RP=0;
end
disp('F1=');
disp(F1)
end
其中M是一个72×24的矩阵。
为什么每次运行后会显示
??? Error using ==> mrdivide
Matrix dimensions must agree.
的错误信息呢?
哪位高手帮忙啊!