function C = minus(A,B)
% C = minus(A,B)
% Computes A-B for cells
% Input: 
%   A and B are cell arrays                     Computes A minus B, Same Behaviour as minus for arrays
%   A or B is a cell array, the other is not    Compute Cell minus Element, for all elements in the cell
%
% E.g.: num2cell(randn(3))-num2cell(randn(3))
%       num2cell(randn(3,2))-randn(1,2)
% 
% See also: cell/plus, minus
%
% Written by: tommsch, 2018

if(iscell(A) && ~iscell(B))
    C=cellfun(@(x) x-B,A,'UniformOutput',false);  %# Apply plus cell-wise
elseif(~iscell(A) && iscell(B))
    C=cellfun(@(x) x-A,B,'UniformOutput',false);  %# Apply plus cell-wise
elseif(iscell(A) && iscell(B))
  C = cellfun(@minus,A,B,'UniformOutput',false);
end
end