MatrixBerryCore
getfirstdimsize.m
Go to the documentation of this file.
1 function sizeVec=getfirstdimsize(value,nDims)
2 if ~isnumeric(nDims)||numel(nDims)~=1||...
3  fix(nDims)~=nDims||nDims<0
4  %
5  mxberry.core.throwerror('wrongInput',...
6  'nDims is expected to be a scalar positive integer value');
7 end
8 %
9 if nDims==1
10  sizeVec=size(value,1);
11 else
12  sizeCVec=cell(1,max(ndims(value),nDims));
13  [sizeCVec{:}]=size(value);
14  sizeVec=[sizeCVec{1:nDims}];
15 end
16 
function getfirstdimsize(in value, in nDims)
GETFIRSTDIMSIZE returns a size vector for the first N dimensions where N is specified.