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
| pathname = uigetdir('C:\MATLAB701\work\IMP\DATA\', 'Pick a Directory');
nomfichier0=fullfile(pathname,'PhData.int');
nomfichier1=fullfile(pathname,'Imp1.int');
nomfichier2=fullfile(pathname,'Imp2.int');
nomfichier3=fullfile(pathname,'Imp3.int');
nomfichier4=fullfile(pathname,'Imp4.int');
nomfichier5=fullfile(pathname,'Imp5.int');
nomfichier6=fullfile(pathname,'Imp6.int');
fid0=fopen(nomfichier0);
fid1=fopen(nomfichier1);
fid2=fopen(nomfichier2);
fid3=fopen(nomfichier3);
fid4=fopen(nomfichier4);
fid5=fopen(nomfichier5);
fid6=fopen(nomfichier6);
valeurs_ph=fread(fid0,'short')/10;
valeurs_Imp1=fread(fid1,'short');
valeurs_Imp2=fread(fid2,'short');
valeurs_Imp3=fread(fid3,'short');
valeurs_Imp4=fread(fid4,'short');
valeurs_Imp5=fread(fid5,'short');
valeurs_Imp6=fread(fid6,'short');
valeurs_Imp_global=[valeurs_Imp1;valeurs_Imp2;valeurs_Imp3;valeurs_Imp4;valeurs_Imp5;valeurs_Imp6];
[nelements,xcenter]=hist(valeurs_Imp_global);
pourcentage=(nelements/sum(nelements))*100;
[nelements_1024,xcenter_1024]=hist(valeurs_Imp_global,1024);
pourcentage_1024=(nelements_1024/sum(nelements_1024))*100;
[nelements_2048,xcenter_2048]=hist(valeurs_Imp_global,2048);
pourcentage_2048=(nelements_2048/sum(nelements_2048))*100;
[nelements_4096,xcenter_4096]=hist(valeurs_Imp_global,4096);
pourcentage_4096=(nelements_4096/sum(nelements_4096))*100;
%Tracé des différents histogrammes
figure(1)
subplot(2,2,1);
hist(valeurs_Imp_global);
title('histogramme standard : découpage en 10');
subplot(2,2,2);
hist(valeurs_Imp_global,1024);
title('histogramme : découpage en 1024');
subplot(2,2,3);
hist(valeurs_Imp_global,2048);
title('histogramme : découpage en 2048');
subplot(2,2,4);
hist(valeurs_Imp_global,4096);
title('histogramme : découpage en 4096');
%Tracé des courbes d'impédances séparées
figure(2)
subplot(2,3,1)
plot(valeurs_Imp1);
xlabel('Nombres de points pour 1 Hz');
ylabel('Valeur Imp1');
subplot(2,3,2)
plot(valeurs_Imp2);
xlabel('Nombres de points pour 1 Hz');
ylabel('Valeur Imp2');
subplot(2,3,3)
plot(valeurs_Imp3);
xlabel('Nombres de points pour 1 Hz');
ylabel('Valeur Imp3');
figure(3)
subplot(3,3,1)
plot(valeurs_Imp4);
xlabel('Nombres de points pour 1 Hz');
ylabel('Valeur Imp4');
subplot(3,3,2)
plot(valeurs_Imp5);
xlabel('Nombres de points pour 1 Hz');
ylabel('Valeur Imp5');
subplot(3,3,3)
plot(valeurs_Imp6);
xlabel('Nombres de points pour 1 Hz');
ylabel('Valeur Imp6');
%tracé de la courbe d'impédance globale et du pH
figure(4)
subplot(2,2,1)
plot(valeurs_Imp_global);
xlabel('Nombres de points pour 1 Hz');
ylabel('Valeur Imp_global');
subplot(2,2,2)
plot(valeurs_Imp_global,'r');
xlabel('Nombres de points pour 1 Hz');
ylabel('Valeur pH'); |
Partager