-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathFind_QDB.m
32 lines (31 loc) · 915 Bytes
/
Find_QDB.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
function [QDB,vals2,potentials] = Find_QDB(vals2)
vals2=round(vals2,4);
f1s=vals2(1:end-1);
QDB=NaN(200,1);
q=1;
potentials = NaN(400,1);
p=1;
tol=.01;
for i = 1:length(f1s)
f1=f1s(i);
for c = i+1:length(vals2);
f2=vals2(c);
for k = 1:3
case1=round(((k*f2)-(k*f1)),4);
case2=round(((k*f2)+(k*f1)),4);
potentials(p)=case1;
potentials(p+1)=case2;
p=p+2;
if case1>0 && ismembertol(case1,vals2,tol)==0 && ismembertol(case1,(vals2*2),tol)==0 && ismembertol(case1,(vals2*3),tol)==0
QDB(q)=case1;
q=q+1;
elseif case2>0 && ismembertol(case2,vals2,tol)==0 && ismembertol(case2,(vals2*2),tol)==0 && ismembertol(case2,(vals2*3),tol)==0
QDB(q)=case2;
q=q+1;
else
end
end
end
end
QDB(isnan(QDB))=[];
end