Commit b30f0a16 authored by Andrew Cohen's avatar Andrew Cohen
Browse files

use nwdmin

parent bb561517
......@@ -44,24 +44,23 @@ for i=1:length(words)
% w2=w2(1:NW);
% w2x=w2x(1:NW);
% NWD1x(i)=NWD(w1x)-NWD(w1x,1);
% NWD1(i)=NWD(w1)-NWD(w1,1);
% NWD2x(i)=NWD(w2x)-NWD(w2x,1);
% NWD2(i)=NWD(w2)-NWD(w2,1);
NWD1x(i)=NWD(w1x);
NWD1(i)=NWD(w1);
NWD2x(i)=NWD(w2x);
NWD2(i)=NWD(w2);
% d1(i)=(NWD1x(i)-NWD1(i))./max(abs(NWD1x(i)),abs(NWD1(i)));
% d2(i)=(NWD2x(i)-NWD2(i))./max(abs(NWD2x(i)),abs(NWD2(i)));;
NWD1x(i)=NWD(w1x)-NWD(w1x,1);
NWD1(i)=NWD(w1)-NWD(w1,1);
NWD2x(i)=NWD(w2x)-NWD(w2x,1);
NWD2(i)=NWD(w2)-NWD(w2,1);
% NWD1x(i)=NWD(w1x);
% NWD1(i)=NWD(w1);
% NWD2x(i)=NWD(w2x);
% NWD2(i)=NWD(w2);
d1(i)=(NWD1x(i)-NWD1(i));
d2(i)=(NWD2x(i)-NWD2(i));
if isnan(d2(i))
if isnan(d2(i)) % f(X)=0 --> -log2(0)==Inf
d2(i)=Inf;
end
if d1(i)<d2(i)
% if abs(d1(i))<abs(d2(i))
% if abs(d1(i))<abs(d2(i)) % magnitude?
fprintf('1,');
else
fprintf('2,');
......@@ -76,7 +75,7 @@ for i=1:length(words)
else
nTrue=2;
end
%if abs(d1(i))<abs(d2(i))
%if abs(d1(i))<abs(d2(i)) % magnitude?
if (d1(i))<(d2(i))
nPred=1;
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment