As input I have a vector of a few million char, which can be 'A', 'C', 'G', 'T'. The vector is called sequence.
As output I want a vector with the cumulative sums of the elements of the input vector, after I have converted its chars in numbers. This code works, but takes forever. What might be the problem?
n = numel(sequence);
skew = zeros(1,n+1,'int32');
for i = 1:n
skew(i+1) = skew(i)-1;
skew(i+1) = skew(i)+1;
skew(i+1) = skew(i);
By the way, I am not interested in the cumulative sums vectors as is. The only thing I care is the index of its minimum.