Skip to content

Commit 902a2e5

Browse files
committed
Implemented overloaded dims function (@marcsous)
1 parent b3285a0 commit 902a2e5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

MappedTensor.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,18 @@ function delete(mtVar)
550550
end
551551
end
552552

553+
% ndims - METHOD Overloaded ndims function
554+
function [nDim] = ndims(mtVar, varargin)
555+
% - If varargin contains anything, a cell reference "{}" was attempted
556+
if (~isempty(varargin))
557+
error('MappedTensor:cellRefFromNonCell', ...
558+
'*** MappedTensor: Cell contents reference from non-cell obejct.');
559+
end
560+
561+
% - Return the total number of dimensions in the tensor
562+
nDim = length(size(mtVar));
563+
end
564+
553565
% numel - METHOD Overloaded numel function
554566
function [nNumElem] = numel(mtVar, varargin)
555567
% - If varargin contains anything, a cell reference "{}" was attempted

0 commit comments

Comments
 (0)