1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
| clear all
% Ouverture fu fichier des fréquences de pattern %
[Frequence PILOTE]= xlsread('pilote.xlsx');
% Creation du fichier de sortie
mult=size(PILOTE);
a=1;
compt=1;
pilote1=1;
pilote2=2;
for i=1:mult
% groupe(1,a)=PILOTE(i,1);
% a=a+2;
% i=i+1;
% Recherche du nombre d'elements pour le pilote
M=Frequence(compt,:);
MC=num2str(M(:))';
n=0;
for j=1:length(M)
for i=j:length(M)
n=n+1;
R(n,1)=str2num(MC(j:i));
R(n,2)=length(strfind(MC,MC(j:i)));
end
end
disp(R);
displays=sortrows(R,-2);
% Recherche des éléments unique et concaténation
taille=size(R);
i=1;
k=1;
for i=1:taille(1);
if displays(i,1)>111 % AU moins 3 instruments
if displays(i,2)>3; % Au moins 3 fois par pilote
sortie(k,1)=displays(i,1);
sortie(k,2)=displays(i,2);
unicite(k,1)=displays(i,1);
k=k+1;
end
end
end
uv=unique(unicite);
i=1;
j=1;
l=size(sortie);
ll=size(uv);
for i=1:ll(1);
tab(i,1)=uv(i);
for j=i:l(1);
if tab(i,1)==sortie(j,1)
tab(i,2)=sortie(j,2);
end
j=j+1;
end
end
tab2=sortrows(tab,-2); % Affichage principales occurences en fonction des circuits visuels
% Creation du fichier de sortie final
i=1;
j=2;
for i=1:ll
groupe(j,pilote1)=tab(i,1);
groupe(j,pilote2)=tab(i,2);
j=j+1;
end
pilote1=pilote1+1;
pilote2=pilote2+1;
compt=compt+1;
end |
Partager