LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SignalType.m
1classdef (Sealed) SignalType
2 % Enumeration of signal types for signal classes.
3 %
4 % Copyright (c) 2012-2026, Imperial College London
5 % All rights reserved.
6
7 properties (Constant)
8 NEGATIVE = 1; % Negative customer signal
9 REPLY = 0; % Reply signal
10 end
11
12 methods (Static)
13 function text = toText(type)
14 % TEXT = TOTEXT(TYPE)
15 switch type
16 case SignalType.NEGATIVE
17 text = 'negative';
18 case SignalType.REPLY
19 text = 'reply';
20 otherwise
21 line_error(mfilename, 'Unrecognized signal type.');
22 end
23 end
24
25 function type = fromText(text)
26 % TYPE = FROMTEXT(TEXT)
27 if iscell(text)
28 text = text{:};
29 end
30 switch lower(text)
31 case 'negative'
32 type = SignalType.NEGATIVE;
33 case 'reply'
34 type = SignalType.REPLY;
35 otherwise
36 line_error(mfilename, 'Unrecognized signal type text.');
37 end
38 end
39 end
40end