I am running a for loop to determine the min,max, and mean of a DNA sequence. When I try to run the program it outputs zero as the value of the min max and mean. I can't find a solution to why the loop is not running properly. Does anyone have a fix?
load('chr1_sect.mat')numBases = length(dna);startPoint = 0; nump = 0;for k = 1:3:numBases-2 if startPoint == 0 if dna(k) == '1' && dna(k+1) == '4' && dna(k+2) == '3' startpoint = k; end else if ((dna(k)) == '4' && dna(k+1) == '1' && dna(k+2)) == '1' ||... (((dna(k))) == '4' && dna(k+1) == '1' && dna(k+2)) == '3' ||... (((dna(k))) == '4' && dna(k+1) == '3' && dna(k+2)) == '1' nump = nump +1; SavedPoints(np,1) = startPoint; SavedPoints(np,2) = k; startPoint = 0; end endendx = min(nump)y = max(nump)z = mean(nump)
Best Answer