-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMini_project_FIG5.m
More file actions
38 lines (29 loc) · 924 Bytes
/
Mini_project_FIG5.m
File metadata and controls
38 lines (29 loc) · 924 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
% To be called within Mini_project_MAIN.m after section 2.6
F5.fig = figure('Units','Centimeters','Position',[2,2,21-5,7],...
'Name','Comparison increasing degree');
F5.ax(1)=subplot(1,2,1);
grid on
box on
hold on
plot(polynomials,moment_mean,'k-o')
plot(polynomials,moment_variance,'-s','color',[0.7 0.7 0.7])
legend('Mean value','Variance')
xlabel('polynomial degree {\it p}')
ylabel('Relative error')
set(gca,'yscale','log')
F5.ax(2)=subplot(1,2,2);
grid on
box on
hold on
plot([incn.n],rel_error_n_mu,'k-o')
plot([incn.n],rel_error_n_var,'-s','color',[0.7 0.7 0.7])
legend('Mean value','Variance')
xlabel('Number of samples in the experimental design {\it n}')
ylabel('Relative error')
set(gca,'yscale','log')
% set limits
ylim1 = get(F5.ax(1),'YLim');
ylim2 = get(F5.ax(2),'YLim');
ylimits = [min([ylim1(1),ylim2(1)]), max([ylim1(2),ylim2(2)])];
set(F5.ax(1),'YLim',ylimits);
set(F5.ax(2),'YLim',ylimits);