2 nExpected=prod(objSizeVec);
3 if ~isa(fTypeCheckFunc,
'function_handle')
5 'expectedType is expected to be a function_handle');
7 if ~(isnumeric(nExpected)&&(fix(nExpected)==nExpected))
10 'nExpected is expected to be an integer positive number');
13 valueLength=numel(value);
15 if fTypeCheckFunc(value)
16 if valueLength==nExpected
19 if valueLength==1&&iscell(value)&&fTypeCheckFunc(value{1})
21 [
'an ambiguous attempt to assign the value: ',...
22 'the value''s type is correct but it is a cell and its content',...
23 'also has a correct type']);
25 valueList=
repmat({value},objSizeVec);
28 [
'the passed value''s length (%d) doesn''t equal the expected ',...
30 valueLength,nExpected);
33 if (valueLength==nExpected)
34 if all(cellfun(fTypeCheckFunc,value))
38 [
'all elements of passed cell ',...
39 'array are expected to have the type specified by ',...
40 'function %s '],func2str(fTypeCheckFunc));
43 valueList=
repmat(value,objSizeVec);
46 [
'the passed value''s length (%d) doesn''t equal the expected ',...
48 valueLength,nExpected);
52 'the passed value''s type (%s) is not expected',...
function num2cell(in inpArray, in varargin)
NUM2CELL is an extension of Matlab built-in function "num2cell" designed to work correctly with empty...
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 repmat(in inpArray, in varargin)
function processpropvalue(in objSizeVec, in value, in fTypeCheckFunc)
PROCESSPROPVALUE is a helper function for assigning property values especially when a set of values s...