Commit af5f40ee authored by Ferdinand Fischer's avatar Ferdinand Fischer
Browse files

simplification of is empty, see #11

parent 4ec292a2
......@@ -1635,19 +1635,15 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete < handle & matlab.mi
% ISEMPTY checks if the quantity object is empty
% empty = isempty(obj)
% check if there is any dimension which is zero
% Check if there is any dimension which is zero
empty = any(size(obj) == 0);
% if the constructor is called without arguments, a
% quantity.Discrete is initialized without an initialization of
% the grid. Thus, the grid is not a cell:
% If the constructor is called without arguments, a
% quantity.Discrete is created without an initialization of
% the grid. Thus, the quantity is not initialized and empty if
% the grid is not a cell.
empty = empty || ~iscell(obj(1).grid);
% in order to check this for arrays:
% scalar and array empty check has to be separated because the
% [obj.grid] does only work in the array case.
empty = empty || any(cellfun(@iscell, [obj.grid]));
end % isempty()
function P = ztzTimes(a, b)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment