From: ambrosia nightwish on 13 Apr 2010 18:09 "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hp9pt1$go1$1(a)fred.mathworks.com>... > Something like this? > > s = 'AACCGTTAACGT'; > k = 3; > > d = double(s); > A = hankel(d(1:end-k+1),d(end-k+1:end)); > [u i j] = unique(A,'rows'); > b = zeros(length(i),1); > c = zeros(size(j)); > for n=1:length(j) > jn = j(n); > b(jn) = b(jn)+1; > c(n) = b(jn); > end > > S = char(A) > c > > % Bruno How to convert S into a vector??
From: us on 13 Apr 2010 18:45 "ambrosia nightwish" <mess_imen(a)yahoo.fr> wrote in message <hq2q20$aqn$1(a)fred.mathworks.com>... > "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hp9pt1$go1$1(a)fred.mathworks.com>... > > Something like this? > > > > s = 'AACCGTTAACGT'; > > k = 3; > > > > d = double(s); > > A = hankel(d(1:end-k+1),d(end-k+1:end)); > > [u i j] = unique(A,'rows'); > > b = zeros(length(i),1); > > c = zeros(size(j)); > > for n=1:length(j) > > jn = j(n); > > b(jn) = b(jn)+1; > > c(n) = b(jn); > > end > > > > S = char(A) > > c > > > > % Bruno > > How to convert S into a vector?? what kind of ...vector... do you mean(?)... us
From: dpb on 13 Apr 2010 18:48 ambrosia nightwish wrote: .... > How to convert S into a vector?? You mean like S(:)' % ? --
From: ambrosia nightwish on 13 Apr 2010 20:25 "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hp9pt1$go1$1(a)fred.mathworks.com>... > Something like this? > > s = 'AACCGTTAACGT'; > k = 3; > > d = double(s); > A = hankel(d(1:end-k+1),d(end-k+1:end)); > [u i j] = unique(A,'rows'); > b = zeros(length(i),1); > c = zeros(size(j)); > for n=1:length(j) > jn = j(n); > b(jn) = b(jn)+1; > c(n) = b(jn); > end > > S = char(A) > c > > % Bruno How to convert S into a vector??
From: us on 14 Apr 2010 03:59 "ambrosia nightwish" <mess_imen(a)yahoo.fr> wrote in message <hq3213$eua$1(a)fred.mathworks.com>... > "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hp9pt1$go1$1(a)fred.mathworks.com>... > > Something like this? > > > > s = 'AACCGTTAACGT'; > > k = 3; > > > > d = double(s); > > A = hankel(d(1:end-k+1),d(end-k+1:end)); > > [u i j] = unique(A,'rows'); > > b = zeros(length(i),1); > > c = zeros(size(j)); > > for n=1:length(j) > > jn = j(n); > > b(jn) = b(jn)+1; > > c(n) = b(jn); > > end > > > > S = char(A) > > c > > > > % Bruno > > How to convert S into a vector?? instead of just dumbly repeating your post, you should answer the questions people have asked you... your performance here in CSSM is not boding well for your future... us
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: efficient storage, subsets of a set Next: Finding First 50 max. values in an array |