I have written a code which will accepts a sequence and convert it to specific numerical sequence. The code is given below–
if true % code
endfunction[xA]=dnatobinary(sample_dna)for i=1:length(sample_dna)if sample_dna(i)=='A'|| sample_dna='a'xA(i)=01;elseif sample_dna(i)=='T' || sample_dna='t'xA(i)=11;endendend
Now this code should convert 'ATTTA' into '0111111101'. Instead it is converting it as '11111111' i.e the leading zero for A=01 is missing.please provide appropriate coding.
Best Answer