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
| clear all
close all
speed=['2';'3';'4';'5'];
dog=['3196';'3197';'3198'];
month=['01';'02';'03';'04';'05';'06';'07';'08';'09';'10';'11';'12'];
index=0;
dimdog=size(dog);
counter=0;
Cvide=zeros(1,16);
C(1,:)=Cvide;
for s_chosen=1:1:length(speed)
for d_chosen=1:1:dimdog(1)
for m_chosen=1:1:length(month)
index=index+1;
s_index=speed(s_chosen,:);
d_index=dog(d_chosen,:);
m_index=month(m_chosen,:);
for num=0:100
if num == 0
nom=strcat(dog(d_chosen,:),'_',speed(s_chosen,:),'_',month(m_chosen,:),'.xls');
end
if num~=0
nom=strcat(dog(d_chosen,:),'_',speed(s_chosen,:),'_',month(m_chosen,:),'_',num2str(num),'.xls');
end
fileopen=fopen(nom);
if fileopen~=-1
counter=counter+1;
C(counter,:)=Cvide;
C2=xlsread(nom);
C(counter,:)=C2(1,:);
dogstudied(counter)=d_chosen;
speedstudied(counter)=s_chosen;
monthstudied(counter)=m_chosen;
end
end
resultat(index)=1;
end
end
end
for d=1:1:dimdog(1)
for v=1:1:length(speed)
for m=1:1:length(month)
mean_m(v,m)=0;
indexchien=find(dogstudied==d);
indexvitesse=find(speedstudied==v);
indexmois=find(monthstudied==m);
indexchienvitesse=intersect(indexchien,indexvitesse);
indexchienmois=intersect(indexchien,indexmois);
indexcomplet=intersect(indexchienvitesse,indexchienmois);
valeursok=C(indexcomplet,:);
% for i=1:size(C(indexcomplet,:))
mean_m(v,m)=nanmean(nanmean(valeursok));
ecart(v,m)=nanstd(nanstd(valeursok));
% end
end
end
figure (1)
subplot(length(dog),1,d)
barwitherr(ecart',mean_m')
xlabel('month')
ylabel('snr')
l=legend(speed,'Location','SouthEastOutside');
v = get(l,'title');
set(v,'string','Speed (mph)');
titre=dog(d,:);
title(['Dog ',num2str(titre)]) |
Partager