-
Notifications
You must be signed in to change notification settings - Fork 1
/
meanHs.m
42 lines (34 loc) · 1.02 KB
/
meanHs.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
% MATLAB script meanHs
%
% Alexandre Noll Marques
% MIT
%
% This script evaluates the mean of the multi-run model for H*, as
% described in AIAA Journal paper AIAAJ_2016-11-J055877
%
% This script depends on the data file Hs_multiRun.mat and the functions
% - meanPosteriorMultiRun.m
% - se1dNoise.m
% - seScaled1d.m
% - zeromean.m
%
% The results are written into a text file
%
% -------------------------------------------------------------------------
%
% User inputs:
%
% H: real vector, values of the shape factor H at which the mean is
% computed
%
H = linspace(2, 14, 100);
% -------------------------------------------------------------------------
disp('Reading file Hs_multiRun.mat...')
load('Hs_multiRun.mat', 'pos')
disp('Computing the mean...')
Hs_mean = meanPosteriorMultiRun(H, pos, 2);
disp('Writing values to file...')
filename = 'Hs_mean.txt';
fid = fopen(filename, 'w');
fprintf(fid, '%10.3e %10.3e\n', [H;Hs_mean']);
disp('meanHs finished succesfully')