-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataMatrix.m
More file actions
executable file
·46 lines (33 loc) · 855 Bytes
/
dataMatrix.m
File metadata and controls
executable file
·46 lines (33 loc) · 855 Bytes
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
function [dataMatrix] = dataMatrix(K,n_i,phiMatrix,L,lambda);
% K is the vector from the bigK calculation
% count is a struct with the getOccurrences result
% occurrences and values
% phiMatrix is the 2000X6 power sequence
% L is 6
% lambda is a coefficient from the generated 2^i
[a b] = size(K); % this should be 1 x 2000
[c d] = size(phiMatrix); % this should be 6 x 2000
[e N] = size(n_i);
s = N + L;
dataMatrix = zeros(s,s);
for i=1:b
dataMatrix(1:a,i) = K(:,i);
end
% I = eye(N)*lambda ;
% dataMatrix = I + dataMatrix;
for i=1:N
for j=1:N
if(i == j)
dataMatrix(i,j) = dataMatrix(i,j) + lambda;
end
end
end
for i=1:c
for j=1:d
phiMatrix(i,j)=phiMatrix(i,j)*n_i(i)/N;
end
end
for j=1:d
dataMatrix(:,N+j) = phiMatrix(:,j);
end
end