-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMaxValues.m
More file actions
45 lines (44 loc) · 827 Bytes
/
Copy pathMaxValues.m
File metadata and controls
45 lines (44 loc) · 827 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
divider = 10000000;
t = linspace(.5,pi,divider);
q=0;
k = [1:100];
q=0;
maxarr = zeros(1,100);
for N = k
x = [0:N];
y = zeros(1,N+1);
var = 1;
while var < N+2;
a = rand;
r = floor((4*a*(var-1))+1);
if var == 1
y(var) = 0;
else
y(var) = y(var) + (y(var-1)+r);
end
var = var + 1;
end
for j = y
q = q + (sin((j+.5).*t))./(sin(.5.*t));
end
b = (1./(N+1)).*q;
m = max(b);
maxarr(N) = maxarr(N) + m;
q = 0;
end
plot(k,maxarr)
h=figure(1);
% saveas(h,['random tails max values', '.pdf']);
% q=0;
% for j = y
% z = [1:j];
% for k = z
% p = p + cos(k.*t);
% end
% p = (2.*p);
% p = p+1;
% q = q + p;
% p=0;
% end
% b= q./(N+1);
% plot(t,b);