forked from openep/openep-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcvHistogram.m
More file actions
59 lines (56 loc) · 1.58 KB
/
cvHistogram.m
File metadata and controls
59 lines (56 loc) · 1.58 KB
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
function cvHistogram( userdata, varargin )
% CVHISTOGRAM Draws a conduction velocity histogram
%
% Usage:
% cvHistogram( userdata )
% Where:
% userdata - see importcarto_mem
%
% CVHISTOGRAM accepts the following parameter-value pairs
% 'limits' {[0 5]} | array
% 'binwidth' {0.1} | double
%
% CVHISTOGRAM displays a histogram of conduction velocities. Limits are set
% to exclude non-physiological conduction velocities
%
% Author: Steven Williams (2020) (Copyright)
% SPDX-License-Identifier: Apache-2.0
%
% Modifications -
%
% Info on Code Testing:
% ---------------------------------------------------------------
% cvHistogram( userdata )
% ---------------------------------------------------------------
%
% ---------------------------------------------------------------
% code
% ---------------------------------------------------------------
nStandardArgs = 1; % UPDATE VALUE
limits = [0 5];
binwidth = 0.1;
if nargin > nStandardArgs
for i = 1:2:nargin-nStandardArgs
switch varargin{i}
case 'limits'
limits = varargin{i+1};
case 'binwidth'
binwidth = varargin{i+1};
end
end
end
% TODO: check format of input values for each parameter are correct
cvdata = getConductionVelocity(userdata);
cvdata(cvdata<limits(1)) = [];
cvdata(cvdata>limits(2)) = [];
histogram(cvdata ...
, 'normalization', 'probability' ...
, 'binwidth', binwidth ...
, 'facecolor', 'k' ...
, 'facealpha', 1 ...
);
set(gcf, 'color', 'w');
xlabel('Conduction Velocity (m/s)');
ylabel('Frequency')
set(gca, 'fontsize', 16)
end