



DNA N-Gram Distribution (strings) Matlab only Given a string s and a number n, write a function nGramFrequency to identify the unique n-gram (n letter sequence) in the string, and the number of times an n-gram (n letter sequence) occurs, where the n-grams can begin at any point in the string. This need comes up in DNA analysis, where the 3-base reading frame for a codon (three letter sequence that could be either T, C, A or G) can begin at any point in the sequence. The identified unique n-gram sequences should be sorted alphabetically. If there are no n-grams, or if the inputs are not of the correct datatype, then outputs should be empty. For example AACTGAACG” ;lengthnGram-3; nGram-requency (s,lengt hnGram) >>[uniquegrams,count] uniquegrams = = 1×6 string array “AAC “ACG””ACT””CTG” GAA” “TGA” count The unique 3-grams are “AAC” “ACG” “ACT” “CTG” “GAA” “TGA”, with the exception of AAC that appears twice, all appear once >> s =”AACTGAACG.. ; lengt hnGram-10; [ uniquegrams , count] uniquegrams = nGramF requency(s,lengt hnGram) = count –





