-
Notifications
You must be signed in to change notification settings - Fork 1
/
makeRRLPeriods.m
44 lines (38 loc) · 908 Bytes
/
makeRRLPeriods.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
function makeRRLPeriods
% original=cd('./RRL');
%
% directory = dir;
% directory = directory(3:end);
%
% before = cd('..');
% filenames = getFileNames(directory);
%
% cd(before);
% [sortFiles, indexes] = sort(filenames);
%
% len = length(sortFiles);
% period = [];
% for j=1:len
% fid = fopen(sortFiles{j});
% line = fgetl(fid);
% line = fgetl(fid); %periodo esta en la segunda linea
% scan = textscan(line, '%s %f %s');
% period = [period; scan{2}]; %periodo
% fclose(fid);
% end
% rrl.names = sortFiles;
% rrl.periods = period;
% cd(original);
%
% save RRL_periods.mat rrl
fileID = fopen('RRL_periods.txt');
scan = textscan(fileID,'%s %f');
fclose(fileID);
nombres = scan{1};
valores = scan{2};
[sNombres, indexes] = sort(nombres);
periods = valores(indexes);
rrl.names = sNombres;
rrl.periods = periods;
save 'RRL_periods.mat' rrl
end