function [f1 f2 sim]= hardCode3() % hardcoded example for simulating purposes % A ~ zipf(3,1), B~ 1-zipf(3,1) % similarity = residual entropy f1 = zeros(64,1); f2 = zeros(64,1); sim = zeros(64,1); A= []; for i=1:64 bin = dec2bin(i-1,6); Features1 = bin(1:3); Features2 = bin(4:6); f1(i) = bin2dec(Features1); f2(i) = bin2dec(Features2); % disp(f1); %disp(f2); 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) = calcTrueProbIntersect(AintersectB(i,:), 'zipf', 0, ... % [3 1]); %[probAnotB(i)] = calcTrueProbExclusive('A', AnotB(i,:), 'zipf', 0, [3 1]); %[probBnotA(i)] = calcTrueProbExclusive('B', BnotA(i,:), 'zipf', 0,[3 1]); %disp('probAintersectB'); %disp(probAintersectB); %disp('probAnotB'); %disp(probAnotB); %disp('probBnotA'); %disp(probBnotA); %disp('sim'); %Sim = simLin(probAintersectB(i), probAnotB(i), probBnotA(i)); Sim = 0; % if(f1(i) == 0 && f2(i) == 1) Sim = simRe(f1(i), f2(i), AintersectB(i,:), AnotB(i,:), BnotA(i,:), 'zipf', [3 1]); % end %disp(simLin(probAintersectB, probAnotB, probBnotA)); sim(i) = Sim; A = [A; f1(i) f2(i) Sim AintersectB(i,:) AnotB(i,:) BnotA(i,:)]; end success = xlswrite('zipf-re-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');