Team:Alberta/Project/Modeling/InvertListArray

From 2009.igem.org

Revision as of 03:45, 18 October 2009 by Ebennett (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
%Takes the genes in WithThis that are not in the first list of InvertThisArray, and puts them all
%in a new list inside InvertedList. Repeats for every list in
%InverThisArray.  %The array must be the first input argument!!!


function [InvertedListArray] = InvertListArray(InvertThisArray, WithThis)


for y = 1:length(InvertThisArray)

InvertedList=cell(1);
Match=zeros(size(WithThis));
for a=(1:length(InvertThisArray{y}))
    for b=(1:length(WithThis))
        if strcmp(InvertThisArray{y}(a), WithThis(b)) == 1
            Match(b)=1;
        end
    end
end
d=1;
for c=(1:length(WithThis))
    if Match(c)==0
        InvertedList(d)=WithThis(c);
        d=d+1;
    end
end
InvertedListArray{y}=InvertedList'
SizeOfInvertedList=size(InvertedList);

end