-
Notifications
You must be signed in to change notification settings - Fork 2
/
xcorrpairget.m
35 lines (31 loc) · 1019 Bytes
/
xcorrpairget.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
function [ pairname ] = xcorrpairget( ...
singledata_dir, component )
%XCORRPAIRGET Summary of this function goes here
% Detailed explanation goes here
pairlist_name = 'pair';
num_component = numel(component);
pairlist = cellfun(...
@strcat, ...
repmat({pairlist_name}, 1, num_component), ...
repmat({'_'}, 1, num_component), ...
num2cell(component), ...
'UniformOutput', false);
net_dir = dir(singledata_dir);
net_name = {net_dir([net_dir.isdir] == 1).name};
net_name = net_name(3: end);
num_net = numel(net_name);
for ii = 1: num_net
pairlistfile = fullfile(singledata_dir, net_name(ii), pairlist);
pairlistID = ...
cellfun(@fopen, pairlistfile, repmat({'r'}, 1, num_component));
pairname = ...
cellfun(...
@textscan, ...
num2cell(pairlistID), ...
repmat({'%s'}, 1, num_component), ...
'UniformOutput', false);
pairname = horzcat(pairname{:});
pairname = horzcat(pairname{:});
end
arrayfun(@fclose, pairlistID);
end