-
Notifications
You must be signed in to change notification settings - Fork 0
/
eid.m
38 lines (30 loc) · 747 Bytes
/
eid.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
function eid = eid(varargin)
% eid = eid()
% eid = eid(string)
% Local function that generates error id that begins with K:
% NOTE: onlyt to be used as a local function.
%
% input argument
% str (Optional) string in char type (row vector)
%
% output argument
% eid an error id composed of 'K:(functionname):str'
%
% Written by Kouichi C. Nakamura Ph.D.
% MRC Brain Network Dynamics Unit
% University of Oxford
% 12-Dec-2016 16:17:33
narginchk(0, 1);
p = inputParser;
p.addOptional('str', '', @(x) isempty(x) || ischar(x) && isrow(x));
p.parse(varargin{:});
str = p.Results.str;
if isempty(str)
str = '';
else
str = [':', str];
end
[~,m,~] = fileparts(mfilename('fullpath'));
eid = ['K:', m, str];
end