-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpetJoin.m
48 lines (48 loc) · 1.13 KB
/
petJoin.m
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
function [PET,failai,path]=petJoin(Pc)
% choose files to summarise
if nargin==0
[failai,path]=uigetfile('*.mat','Choose experiment data files','MultiSelect','on');
if ~iscell(failai)
failai={failai};
end
if all(failai{1}==0)
failai=[];
path=[];
PET=[];
return;
end
byla0=failai{1};
byla0=[path,byla0];
for a=1:size(failai,2)
Pc(a)={petLoad([path,failai{a}])};
end
end
PET=Pc{1};
str0=petDenominat(PET);
for a=2:length(Pc)
pet=Pc{a};
str=petDenominat(pet);
if strcmp(str,str0)% && strcmp(PET0.ExPar.PsychoMethod,pet.ExPar.PsychoMethod)
PET=[PET pet];
else
disp([mat2str(a),'file was not included!']);
end
end
t=length(PET);
k=[];
for a=1:t-1
for b=a+1:t
if all(PET(a).Saved==PET(b).Saved)
k=[k a];
disp([mat2str(a),' duplicated file was not included']);
end
end
end
PET(k)=[];
if nargout==0 && t>1
[cfile,npath] = uiputfile(byla0,'Save experiment data');
if cfile==0
return;
end
save ([npath,cfile], 'PET');
end