Added source Matlab code for reference

This commit is contained in:
Waldir Leoncio 2019-12-16 16:47:21 +01:00
parent b8af977117
commit b5d99903d2
186 changed files with 61405 additions and 1 deletions

View file

@ -0,0 +1,31 @@
function tf = opttf(pval)
%OPTTF determines whether input options are true or false
% Copyright 2003-2004 The MathWorks, Inc.
% $Revision: 1.3.4.2 $ $Date: 2004/12/24 20:42:39 $
if islogical(pval)
tf = all(pval);
return
end
if isnumeric(pval)
tf = all(pval~=0);
return
end
if ischar(pval)
truevals = {'true','yes','on','t'};
k = any(strcmpi(pval,truevals));
if k
tf = true;
return
end
falsevals = {'false','no','off','f'};
k = any(strcmpi(pval,falsevals));
if k
tf = false;
return
end
end
% return empty if unknown value
tf = logical([]);