How to convert Matlab .m file to C code?

MATLAB DNA Problem, Help Appreciated?

  • DNA fingerprinting is a way of matching organic material between organisms. The procedure and theory are a bit complex, but the basic concept is finding repeating sequences within a long chain. DNA is made of four nucleotides [adenine (A), cytosine (C), guanine (G), and thymine (T)] arranged in a unique order for each individual of each living species. You can download a file (dna.txt) containing an unknown DNA chain where the nucleotides are represented by numbers 1 = A, 2 = C, 3 = G, and 4 = T. Your task is to write an m-file that will compare the five DNA suspect fragments, found in the five files below, to the suspect DNA chain, and determine which of the fragments, if any, are contained within the unknown DNA chain. Algorithm: You are to do this by comparing the sum of the absolute differences of the suspect fragments with each segment of the unknown DNA chain. The fragment for which the sum of the differences with a segment of the unknown DNA chain is a minimum will be the most likely suspect DNA fragment. Reading data from a file: Last time, we tried to import data from a file by MATLAB menu command. Now, we are going to write program to read data from a file. The code to load a TXT data file is: load yourdatafile.txt; You may put the code above (with the actual file name) into your .M file. The data should be stored in a variable named “yourdatafile” (or your actual file name). Here’re the input files you should download & unzip dna.txt dnafrags1.txt dnafrags2.txt dnafrags3.txt dnafrags4.txt dnafrags5.txt dna.txt file has one column with 97 different components(1-4) Dnafrags1.txt has one column of 16 numbers (1-4 or A,C,G, & T). Dnafrags2.txt has one column of 19 numbers (also 1-4). Dnafrags3.txt has one row of 16 numbers. Dnafrags4.txt has one column of 17 numbers. Dnafrags5.txt has one column of 20 numbers. For example, for dnafrags1.txt I don’t get how I compare that strand with dna.txt for its every 16 pieces (like with 1 to 16, 2 to 17, and 3 to 18 etc. all the way to 97). I know you dont have the actual files but how would you set this up?

  • Answer:

    I can't figure this one out either :/

DK at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

I can't figure this one out either :/

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.