Team:Alberta/Project/Modeling/InvertList
From 2009.igem.org
(Difference between revisions)
Line 2: | Line 2: | ||
%WithThis that are not present in InvertThis. | %WithThis that are not present in InvertThis. | ||
- | + | %Example | |
- | + | %InvertThis = LiteratureGenes; | |
+ | %WithThis=model.genes; | ||
function [InvertedList] = InvertList(InvertThis, WithThis) | function [InvertedList] = InvertList(InvertThis, WithThis) |
Revision as of 17:55, 3 October 2009
%Creates a list of genes called InvertedList that includes all genes in %WithThis that are not present in InvertThis.
%Example %InvertThis = LiteratureGenes; %WithThis=model.genes;
function [InvertedList] = InvertList(InvertThis, WithThis) InvertedList=cell(1); Match=zeros(size(WithThis)); for a=(1:length(InvertThis)) for b=(1:length(WithThis)) if strcmp(InvertThis(a), WithThis(b)) == 1 Match(b)=1; end end a; end d=1; for c=(1:length(WithThis)) if Match(c)==0 InvertedList(d)=WithThis(c); d=d+1; end end InvertedList=InvertedList'; SizeOfInvertedList=size(InvertedList)