% Function for finding relation operator of boolean test L. LAURENT -- 04/05/2018 -- luc.laurent@lecnam.net
0001 %% Function for finding relation operator of boolean test 0002 % L. LAURENT -- 04/05/2018 -- luc.laurent@lecnam.net 0003 0004 % optiGTest - set of testing functions A toolbox to easy manipulate functions. 0005 % Copyright (C) 2018 Luc LAURENT <luc.laurent@lecnam.net> 0006 % 0007 % This program is free software: you can redistribute it and/or modify 0008 % it under the terms of the GNU General Public License as published by 0009 % the Free Software Foundation, either version 3 of the License, or 0010 % (at your option) any later version. 0011 % 0012 % This program is distributed in the hope that it will be useful, 0013 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0015 % GNU General Public License for more details. 0016 % 0017 % You should have received a copy of the GNU General Public License 0018 % along with this program. If not, see <http://www.gnu.org/licenses/>. 0019 0020 0021 function txtFun=boolFun(txtSymbol) 0022 txtFun=''; 0023 if isa(txtSymbol,'function_handle') 0024 txtFun=txtSymbol; 0025 else 0026 switch txtSymbol 0027 case {'==','eq'} 0028 txtFun=@eq; 0029 case {'~=','ne'} 0030 txtFun=@ne; 0031 case {'<=','=<','le'} 0032 txtFun=@le; 0033 case {'>=','=>','ge'} 0034 txtFun=@ge; 0035 case {'<','lt'} 0036 txtFun=@lt; 0037 case {'>','gt'} 0038 txtFun=@gt; 0039 end 0040 end 0041 end