3 DEFAULT_IS_EMPTY_ALLOWED=
false;
4 DEFAULT_IS_CHECKED_FOR_ROW=
true;
6 [~,~,nCallerStackStepsUp]=
mxberry.
core.parseparext(...
8 {
'nCallerStackStepsUp';1;...
9 'isscalar(x)&&isnumeric(x)&&isreal(x)'},0,...
10 'propRetMode',
'separate');
13 flagVec=[DEFAULT_IS_EMPTY_ALLOWED,DEFAULT_IS_CHECKED_FOR_ROW];
14 elseif numel(flagVec)==1
15 flagVec=[flagVec,DEFAULT_IS_CHECKED_FOR_ROW];
17 isEmptyAllowed=flagVec(1);
18 isCheckedForBeingARow=flagVec(2);
20 if isCheckedForBeingARow
21 if ~(
mxberry.
core.isrow(inpArray)||isEmptyAllowed&&isempty(inpArray))
24 '%s is expected to be a row',inputname(1),...
25 'nCallerStackStepsUp',1+nCallerStackStepsUp);
28 '%s is expected to be a row or empty cell',inputname(1),...
29 'nCallerStackStepsUp',1+nCallerStackStepsUp);
36 if ~iscellstr(inpArray)
38 '%s is expected to be a cell array of strings',...
39 inputname(1),
'nCallerStackStepsUp',1+nCallerStackStepsUp);
41 is2DVec=cellfun(
'ndims',inpArray)<=2;
44 [
'%s does have elements on positions %s with ',...
45 'dimensionality >2'],mat2str(find(~is2DVec)),...
46 'nCallerStackStepsUp',1+nCallerStackStepsUp);
48 isRowVec=cellfun(
'size',inpArray,1)==1;
51 [
'%s does have elements on positions %s that are ',...
52 ' matrices instead of rows'],mat2str(find(~isRowVec)),...
53 'nCallerStackStepsUp',1+nCallerStackStepsUp);
function throwerror(in msgTag, in varargin)
THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but s...
function checkcellofstr(in inpArray, in flagVec, in varargin)
CHECKCELLOFSTR checks that input variable is either a char or cell of strings (char is converted to a...