Assume that I have 2 strings of characters:
AACCCGGAAATTTGGAATTTTCCCCAAATACG
CGATGATCGATGAATTTTAGCGGATACGATTC
I want to find by how much I should move the second string such that it matches the first one the most.
There are 2 cases. The first one is that we assume that the string are wrapped around, and the second one is that we don't.
Is there a matlab function that does returns either a N array or 2N+1 array of values for how much the shifted string 2 correlates with string 1?
If not, is there a faster/simpler method than something like
result = zeroes(length, 1)
for i = 0:length-1
result(i+1) = sum (str1 == circshift(str2, i));
end