I'm getting the following error when running isenExpan('a','m',2,1.4,'sub') with the code below:
??? Error using ==> isenExpanArgument 'sonic' failed validation@(x)validatestring(x,validSonic).
code:
function out = isenExpan(from,to,val,gam,varargin)%%error checking
validTypes = {'m', 'a', 'p', 't', 'd'};validSonic = {'super', 'sub'};p = inputParser;p.FunctionName = 'isenExpan';p.addRequired('from', @(x)validatestring(x,validTypes));p.addRequired('to', @(x)validatestring(x,validTypes));p.addRequired('val', @isnumeric);p.addRequired('gam', @(x)validateattributes(x,{'numeric'},{'>',1,'<',1.5}));p.addOptional('sonic', 'super', @(x)validatestring(x,validSonic));p.parse(from,to,val,gam,varargin{:});
I'm giving sonic a valid input, and when I step through itin debug mode, validatestring returns 'sub' and not false.
Has anyone else seen or heard of this problem?
Best Answer