-
Notifications
You must be signed in to change notification settings - Fork 1
/
create_histogram.m
100 lines (80 loc) · 2.63 KB
/
create_histogram.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
function [ ] = create_histogram( model, parameters, several_scheme, BinWidth )
% Create the histograms for the severals parameters
if several_scheme
figure()
histogram(parameters.scheme)
title('Distribution of the schemes');
xlabel('Downwind, Center, Upwind');
if strcmp(model,'first_order_homogenous')
a_upwind=parameters.coefficients_upwind(1,:);
a_downwind=parameters.coefficients_downwind(1,:);
a_center=parameters.coefficients_center(1,:);
figure()
histogram(a_upwind,'BinWidth', BinWidth)
title('Upwind');
xlabel('a');
figure()
histogram(a_center,'BinWidth', BinWidth)
title('Center');
xlabel('a');
figure()
histogram(a_downwind,'BinWidth', BinWidth)
title('Downwind');
xlabel('a');
elseif strcmp(model,'first_order')
a_upwind=parameters.coefficients_upwind(1,:);
a_downwind=parameters.coefficients_downwind(1,:);
a_center=parameters.coefficients_center(1,:);
b_upwind=parameters.coefficients_upwind(2,:);
b_downwind=parameters.coefficients_downwind(2,:);
b_center=parameters.coefficients_center(2,:);
figure()
histogram(a_upwind,'BinWidth', BinWidth)
title('Upwind');
xlabel('a');
figure()
histogram(b_upwind,'BinWidth', BinWidth)
title('Upwind');
xlabel('b');
figure()
histogram(a_center,'BinWidth', BinWidth)
title('Center');
xlabel('a');
figure()
histogram(b_center,'BinWidth', BinWidth)
title('Center');
xlabel('b');
figure()
histogram(a_downwind,'BinWidth', BinWidth)
title('Downwind');
xlabel('a');
figure()
histogram(b_downwind,'BinWidth', BinWidth)
title('Downwind');
xlabel('b');
end
elseif ~several_scheme
if parameters.scheme == 1
str = 'Upwind';
elseif parameters.scheme == 0
str = 'Center';
elseif parameters.scheme == -1
str = 'Downwind';
end
if strcmp(model,'first_order_homogenous')
figure()
histogram(parameters.coefficients(1,:),'BinWidth', BinWidth)
title(str);
xlabel('a');
elseif strcmp(model,'first_order')
figure()
histogram(parameters.coefficients(1,:),'BinWidth', BinWidth)
title(str);
xlabel('a');
figure()
histogram(parameters.coefficients(2,:),'BinWidth', BinWidth)
title(str);
xlabel('b');
end
end
end