-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotGraphSE.m
91 lines (77 loc) · 2.13 KB
/
plotGraphSE.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
function [hh] = plotGraphSE( resultsdir, resultfn, m, Np, Nm, Psi, Nrep, varargin)
%PLOTGRAPHSE Plots the graphs from single emitter using data in file
%
% plotGraphSE( resultsdir, resultfn, m, Np, Nm, Psi, Nrep)
% plotGraphSE( resultsdir, resultfn, m, Np, Nm, Psi, Nrep,t)
%
% Plots the results generated by test_single_em
[res params] = shapeResults(resultsdir, resultfn,m,Np,Nm,Psi,Nrep);
% Position in x and y
xloc = 0:params.Wstep:params.W;
yloc = 0:params.Lstep:params.L;
baseTitle = [ '\{m, N_p, N_m, \Psi \}=\{' num2str(m) ',' ...
num2str(Np) ',' num2str(Nm) ',' ...
num2str(round(180/pi*Psi)) '\}'];
% By default, plot all graphs
plotmax = 1; % Plot max
plotavg = 1; % Plot mean
plotstd = 1; % Plot std dev
if nargin >= 8
t = varargin{1};
if isstr(t)
switch t
case 'max'
plotavg = 0;
plotstd = 0;
case 'avg'
plotmax = 0;
plotstd = 0;
case 'std'
plotmax = 0;
plotavg = 0;
otherwise
warning('t must be one of [max|avg|std]');
end
else
warning('t must be a string!');
end
end
% Vector for storing the graphics handles
hh = zeros(6,1);
if plotmax
% Location error,max
figure
hh(1) = surf(xloc,yloc,(res.locerrormax)');
t = title(['Location, max error | ' baseTitle]);
set(t,'FontWeight','Normal');
% Radius error,max
figure
hh(2) = surf(xloc,yloc,(res.raderrormax)');
t = title(['Radius, max error | ' baseTitle]);
set(t,'FontWeight','Normal');
end
if plotavg
% Location error,mean
figure
hh(3) = surf(xloc,yloc,(res.locerroravg)');
t = title(['Location, mean error | ' baseTitle]);
set(t,'FontWeight','Normal');
% Radius error,mean
figure
hh(4) = surf(xloc,yloc,(res.raderroravg)');
t = title(['Radius, mean error | ' baseTitle]);
set(t,'FontWeight','Normal');
end
if plotstd
% Location error, stddev
figure
hh(5) = surf(xloc,yloc,(res.locerrorstd)');
t = title(['Location , st. dev.| ' baseTitle]);
set(t,'FontWeight','Normal');
% Radius error,stdev
figure
hh(6) = surf(xloc,yloc,(res.raderrorstd)');
t = title(['Radius , st. dev.| ' baseTitle]);
set(t,'FontWeight','Normal');
end
end