Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: word occurence counting (DNA)
Date: Tue, 13 Apr 2010 22:09:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 23
Message-ID: <hq2q20$aqn$1@fred.mathworks.com>
References: <hp0f8k$snf$1@fred.mathworks.com> <hp0fpf$6re$1@fred.mathworks.com> <hp51me$adm$1@fred.mathworks.com> <hp52ih$ofc$1@fred.mathworks.com> <hp53f7$97n$1@fred.mathworks.com> <hp53vc$gtu$1@fred.mathworks.com> <hp54tn$2ii$1@fred.mathworks.com> <hp5cqk$1pr$1@fred.mathworks.com> <hp8ccl$1mu$1@fred.mathworks.com> <hp9pt1$go1$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1271196544 11095 172.30.248.37 (13 Apr 2010 22:09:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 13 Apr 2010 22:09:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1687447
Xref: news.mathworks.com comp.soft-sys.matlab:626322

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <hp9pt1$go1$1@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??