MatrixBerryCore
isfirstdimsizeasspecified.m
Go to the documentation of this file.
1 function isPositive=isfirstdimsizeasspecified(valueArr,sizeVec)
2 import mxberry.core.getfirstdimsize;
3 import mxberry.core.throwerror;
4 %
5 if any(~isnumeric(sizeVec)|size(sizeVec,1)~=1|fix(sizeVec)~=sizeVec|...
6  sizeVec<0|isempty(sizeVec))
7  throwerror('wrongInput',...
8  ['sizeVec is expected to be a row-vector of non-negative ',...
9  'integer numbers']);
10 end
11 %
12 nDims=length(sizeVec);
13 isPositive=isequal(getfirstdimsize(valueArr,nDims),sizeVec);
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 getfirstdimsize(in value, in nDims)
GETFIRSTDIMSIZE returns a size vector for the first N dimensions where N is specified.
function isfirstdimsizeasspecified(in valueArr, in sizeVec)
ISFIRSTDIMSIZEASSPECIFIED check if an input value have a specified size along the first dimensions...