-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfreqToTS.asv
More file actions
42 lines (38 loc) · 1.33 KB
/
freqToTS.asv
File metadata and controls
42 lines (38 loc) · 1.33 KB
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
function freqToTS(opID, theTree,samplingTime)
% disp("Freq")
% disp(opID);
nodeParent = getparent(theTree,opID);
operatorSubTree = theTree.subtree(nodeParent);
%
theNodes = nnodes(operatorSubTree);
s = '';
totalLStr = '';
disp(operatorSubTree.tostring);
for i=1:theNodes
disp(i)
disp(operatorSubTree.get(i));
end
fStr = operatorSubTree.get(8);
f = str2double( fStr );
toleranceString = operatorSubTree.get(7);
toleranceValue = str2double( toleranceString );
if (operatorSubTree.get(f) == '<')
totalF = (1/gTime) + 1;
% totalLStr = string(totalL);
% end
%
% %
% if (operatorSubTree.get(1) == '>')
% totalL = ((l + toleranceValue)/samplingTime) - 1;
% totalLStr = string(totalL);
%
% end
%
% s = strcat('T','(',operatorSubTree.get(9),operatorSubTree.get(8),operatorSubTree.get(10),')','-'...
% ,'T','(',operatorSubTree.get(5),operatorSubTree.get(4),operatorSubTree.get(6),')',operatorSubTree.get(1),totalLStr);
%
% fileID = fopen('convertedConstraints.txt','a');
% fprintf(fileID,s);
% fprintf(fileID,newline);
% fclose(fileID);
end