-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdummy_dos.m
73 lines (57 loc) · 990 Bytes
/
dummy_dos.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
close all;
clear; clc;
step = 1;
kx = 0:step:100;
ky = kx;
kz = ky;
dim = 3;
if(dim == 1)
ky = 0;
kz = 0;
elseif(dim == 2)
kz = 0;
end
E = zeros(1,size(kx,2)^dim);
ctr = 1;
for i1 = kx
for i2 = ky
for i3 = kz
E(ctr) = i1.^2+i2.^2+i3.^2;
ctr = ctr + 1;
end
end
end
%E = kx.^2+ky.^2;
%plot(k,E)
h = histogram(E,500,'Visible','off');
counts = h.BinCounts;
x = linspace(h.BinLimits(1),h.BinLimits(2),size(counts,2));
i = 1;
% while( i <= numel(counts))
% if(counts(i) <= 1e-3)
% %disp("Evet ?")
% %disp(counts(i))
% counts(i) = [];
% x(i) = [];
% continue;
% end
% i = i+1;
% end
A = smoothdata(counts,'Gaussian');
f = figure(1);
A = smoothdata(A,'Gaussian');
plot(f.CurrentAxes,x,A,'-')
f.CurrentAxes.YLim(1) = 0;
% figure;
% E = sort(E);
% % E_sort = sort(E);
% allowed = [];
% occurance= [];
% for i = E;
% if(any(i == allowed))
% continue;
% end
% allowed(end+1) = i;
% occurance(end+1) = sum(E == i);
% end
% plot(allowed,occurance,'.-')