Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
prevent adding repetetive compartments
  • Loading branch information
rasools committed Sep 24, 2020
1 parent 7daa485 commit b591d62
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions addCompartement.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
%
%
%
% Rasool Saghaleyni, 2020-02-22
newModel=model;
newModel.comps = vertcat(model.comps,comps);
newModel.compNames = vertcat(model.compNames,compNames);
% Rasool Saghaleyni, 2020-02-22
% don't add repetitive compartments 2020-09-23
newComps = setdiff(comps, model.comps);
[~, b] = ismember(newComps, comps);
newCompNames = compNames(b);
newModel = model;
newModel.comps = vertcat(model.comps,newComps);
newModel.compNames = vertcat(model.compNames,newCompNames);
end

0 comments on commit b591d62

Please sign in to comment.