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
| clear all
close all
% appel de fichier
[FileName,PathName] = uigetfile('*.txt','sélectionnez les 8 fichiers texte', 'MultiSelect', 'on');
cd(PathName);
for n=1:8
fullfile(PathName, FileName{n});
h.fid{n} = fopen(fullfile(PathName,FileName{n}),'rt');
for k=1:46
fgetl(h.fid{n});
end
X{n}= fscanf(h.fid{n},'%f',[7,inf]).';
fclose(h.fid{n});
idx{n} = X{n}(:,4)>0;
Xpos{n} = X{n}(idx{n},:);
Xneg{n} = X{n}(~idx{n},:);
h.meanneg{n}=mean(-Xneg{n}(:,4));
h.meanpos{n}=mean(Xpos{n}(:,4));
mupos{n}=smooth(Xpos{n}(:,4),1000,'moving');
muneg{n}=smooth(-Xneg{n}(:,4),1000,'moving');
end
% Réglage couleur de fond et dimension de la fenêtre de graphique
h.fi=figure('color',[1 1 1], 'Units','pixels','position',[1 1 1680 929]);
h.ax(1)=subplot(2,1,1);
set(h.ax,'fontname','arial','fontsize',14);
plot(Xpos{1}(:,3),mupos{1},':c',Xpos{2}(:,3),mupos{2},'b',Xpos{3}(:,3),mupos{3},'r',Xpos{4}(:,3),mupos{4},'m',Xpos{5}(:,3),mupos{5},'c',Xpos{6}(:,3),mupos{6},'g',Xpos{7}(:,3),mupos{7},'y',Xpos{8}(:,3),mupos{8},'k');
xlabel('nombre de cycle', 'fontname','arial','fontsize',12,'fontweight','bold')
ylabel('µ_a_p_p', 'fontname','arial','fontsize',12,'fontweight','bold')
h.dx=legend('Ag 2.4mm (4-1)','Au 2.4mm (4-1)','Ag 2.4mm (5-1)','Au 2.4mm (5-1)','Location','Best');
set(h.dx,'fontname','arial','fontsize',10);
title({'Essais sur les échantillons Au 0.5µm et 1µm, 0.5N, 2000c, bille or et argent diamètre 2.4mm','Evolution du coefficient de frottement ','en fonction du nombre de cycles (partie positive)'});
h.bx(1)=subplot(2,1,2);
set(h.bx,'fontname','arial','fontsize',14);
plot(Xneg{1}(:,3),muneg{1},'c',Xneg{2}(:,3),muneg{2},'b',Xneg{3}(:,3),muneg{3},'r',Xneg{4}(:,3),muneg{4},'m',Xneg{5}(:,3),muneg{5},'c',Xneg{6}(:,3),muneg{6},'g',Xneg{7}(:,3),muneg{7},'y',Xneg{8}(:,3),muneg{8},'k');
xlabel('nombre de cycle', 'fontname','arial','fontsize',12,'fontweight','bold')
ylabel('µ_a_p_p', 'fontname','arial','fontsize',12,'fontweight','bold')
h.cx=legend('Ag 2.4mm (4-1)','Au 2.4mm (4-1)','Ag 2.4mm (5-1)','Au 2.4mm (5-1)','Location','Best');
set(h.cx,'fontname','arial','fontsize',10);
title({'Essais sur les échantillons Au 0.5µm et 1µm, 0.5N, 2000c, bille or et argent diamètre 2.4mm','Evolution du coefficient de frottement ','en fonction du nombre de cycles (partie négative)'}); |
Partager