forked from alexdevonport/pfaces-pirk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshowResult_mchd.m
38 lines (28 loc) · 1.04 KB
/
showResult_mchd.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
clear all
clc
% add the interface m files
addpath('../../interface/');
% some cosntants
n_links = 10;
reachlb_file_name = 'minimal_kernel.result_mchd_reachlb.raw';
reachub_file_name = 'minimal_kernel.result_mchd_reachub.raw';
% load the result files
if ~exist(reachlb_file_name, 'file') || ~exist(reachub_file_name, 'file')
error('Please run the example first to generate the files.');
end
reachlb_file = pirkDataFile(reachlb_file_name);
nsamples = str2double(reachlb_file.getMetadataElement('nsamples'));
reachub_file = pirkDataFile(reachub_file_name);
if(nsamples <= 0)
error('The results file has no samples. are you running the MC method ?');
end
disp(['This MC method used ' num2str(nsamples) ' simulations']);
% collect/show the results
reachlb = zeros(1,n_links);
reachub = zeros(1,n_links);
for j=0:n_links-1
reachlb(j+1) = reachlb_file.getElement(j);
reachub(j+1) = reachub_file.getElement(j);
end
disp(['reachlb: ' num2str(reachlb, '%3.3f\t')]);
disp(['reachub: ' num2str(reachub, '%3.3f\t')]);