-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_intervalPSD.m
43 lines (37 loc) · 1.08 KB
/
plot_intervalPSD.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
function p = plot_intervalPSD(w, intervalspectrum, color)
% Function for visualising the upper and lower bound of the imprecise
% stationary power spectrum
%
% INPUT:
% - w: Frequency vector
% - intervalspectrum: Upper and lower bound of the spectrum
% - color: Color of plot hexadecimal
%
% OUTPUT:
% - p: Plot object with specifications
%
% Author:
% Marco Behrendt
% Institute for Risk and Reliability, Leibniz Universität Hannover
% https://github.com/marcobehrendt
%
% Date: 17/03/2022
x = [w fliplr(w)];
y = [intervalspectrum(1,:) fliplr(intervalspectrum(end, :))];
try
face_col_rgb = sscanf(color,'%2x%2x%2x',[1 3])/255;
p = fill(x, y, face_col_rgb);
p.EdgeColor = face_col_rgb;
catch
warning('Unexpected color type. No changes.')
face_col_rgb = 'b';
p = fill(x, y, face_col_rgb);
p.EdgeColor = face_col_rgb;
end
grid on;
grid_col_rgb = sscanf('b0b0b0','%2x%2x%2x',[1 3])/255;
set(gca, 'GridColor', grid_col_rgb)
set(gca, 'GridAlpha', 1)
set(gca, 'Layer', 'top')
end