Skip to content

Commit

Permalink
Correction to previous patch
Browse files Browse the repository at this point in the history
  • Loading branch information
lmendo committed Nov 28, 2017
1 parent 7753211 commit 0b094df
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions compatibility/setxor_comp.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
y = a(x,:);
else
y = a(x);
if isrow(varargin{1}) && isrow(varargin{2})
y = reshape(y,1,[]);
end
end
% Keep partial output:
z = y;
Expand All @@ -52,16 +55,16 @@
y = a(x,:);
else
y = a(x);
if isrow(varargin{1}) && isrow(varargin{2})
y = reshape(y,1,[]);
end
end
% Join partial outputs:
if ~strcmp(varargin{3},'rows') && isrow(varargin{1}) && isrow(varargin{2})
z = horzcat(z, y);
else
z = vertcat(z, y);
end
if size(varargin{1},1)==1 && size(varargin{2},1)==1 % row ouput if first two inputs are rows
z = reshape(z,1,[]);
end
varargout{1} = z;
else
if strcmp(varargin{end},'sorted'), varargin(end) = []; end
Expand Down

0 comments on commit 0b094df

Please sign in to comment.