function [probAintersectB probAnotB probBnotA sim]= hardCode1() % hardcoded example for simulating purposes % A ~ zipf(3,1), B~ 1-zipf(3,1) % similarity = lin f1 = zeros(64,3); f2 = zeros(64,3); sim = zeros(64,1); A= []; for i=1:64 bin = dec2bin(i,6); Features1 = bin(1:3); Features2 = bin(4:6); f1 = bin2dec(Features1); f2 = bin2dec(Features2); for j=1:3 if(Features1(j) == '1') features1(j) =1; elseif(Features1(j) == '0') features1(j)=0; end if(Features2(j) == '1') features2(j) =1; elseif(Features2(j) == '0') features2(j)=0; end end %disp('features1'); %disp(features1); %disp('features2'); %disp(features2); [AintersectB(i,:) AnotB(i,:) BnotA(i,:)] = featurescomp(features1, features2); probAintersectB(i) = calcProbIntersect(AintersectB(i,:), 'zipf', 'zipf',... [3 1], [3 2], 0); [probAnotB(i)] = calcProbExclusive('AnotB', AnotB(i,:), 'zipf', 'zipf', [3 1], [3 2], 0); [probBnotA(i)] = calcProbExclusive('BnotA', BnotA(i,:), 'zipf', 'zipf',[3 1], [3 2], 0); %disp('probAintersectB'); %disp(probAintersectB); %disp('probAnotB'); %disp(probAnotB); %disp('probBnotA'); %disp(probBnotA); %disp('sim'); Sim = simLin(probAintersectB(i), probAnotB(i), probBnotA(i)); if(f1 == f2) disp('pAintersectB'); disp(probAintersectB(i)); disp('pAnotB'); disp(probAnotB(i)); disp('pBnotA'); disp(probBnotA(i)); disp(Sim); end %disp(simLin(probAintersectB, probAnotB, probBnotA)); sim(i) = Sim; %A = [A; f1 f2 Sim probAintersectB(i) probAnotB(i) probBnotA(i)]; A = [A; f1 f2 Sim]; end success = xlswrite('zipf-lin-3', A); i = 1:1:64; plot(i,probAintersectB,'go', i, probAnotB, 'ro', i, probBnotA, 'bo', i, sim, 'ko'); %subplot(4,1,1), plot(i,probAintersectB,'o'); %subplot(4,1,2), plot(i,probAnotB,'o'); %subplot(4,1,3), plot(i,probBnotA,'o'); %subplot(4,1,4), plot(sim,'o');