1 %This file is part of TEAP.
3 %TEAP is free software: you can redistribute it and/or modify
4 %it under the terms of the GNU General Public License as published by
5 %the Free Software Foundation, either version 3 of the License, or
6 %(at your option) any later version.
8 %TEAP is distributed in the hope that it will be useful,
9 %but WITHOUT ANY WARRANTY; without even the implied warranty of
10 %MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 %GNU General Public License
for more details.
13 %You should have received a copy of the GNU General Public License
14 %along with TEAP. If not, see <http://www.gnu.org/licenses/>.
17 %> @brief Asserts that the signal is a TEAP one
19 %> @param Signal: the signal to test
20 %> @param minVal: the minimum value (
default to -Inf)
21 %> @param maxVal: the maximum value (defaults to +Inf)
22 %> @param soft:
boolean indicating
if the assert is soft (i.e. 1 -> warning) or hard (i.e. 0 -> error), defaults to 0
24 %> @author Copyright Guillaume Chanel, 2016
27 if(nargin > 4 || nargin < 1)
28 error(
'Usage: Signal__assert_mine(Signal)');
43 %Check the range of signals and construct potential warning/error
48 msg = [msg
'The value ' num2str(minSig)
' is too low for ' Signal__get_signame(Signal)
' signals (min = ' num2str(minVal)
'). '];
54 msg = [msg
'The value ' num2str(maxSig)
' is too high for ' Signal__get_signame(Signal)
' signals (max = ' num2str(maxVal)
'). '];
59 warning([msg
'This might lead to other warnings']);