-
Notifications
You must be signed in to change notification settings - Fork 1
/
DNA_encode_rule03.m
43 lines (33 loc) · 1.42 KB
/
DNA_encode_rule03.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% Function for DNA encoding based on rule 03
%------------------------------------------------------------------------
function d = DNA_encode_rule03(P,mn)
%------------------------------------------------------------------------
% STEP 1:Creating an empty string array for DNA encoding
%------------------------------------------------------------------------
d = [];
k1 = [];
k2 = [];
%------------------------------------------------------------------------
% STEP 2:DNA Convertion table -rule 03
%------------------------------------------------------------------------
% Checking first two bits
%------------------------------------------------------------------------
for i = 1:mn
%___
if x(1) == '0' && x(2) == '0'
k1 = 'C';
elseif x(1) == '0' && x(2) == '1'
k1 = 'A';
elseif x(1) == '1' && x(2) == '0'
k1 = 'T';
elseif x(1) == '1' && x(2) == '1'
k1 = 'G';
end
%-------------------------------------------------------------------------
% Checking next two bits
%-------------------------------------------------------------------------
% if you need complete code contact me
%-------------------------------------------------------------------------
% STEP 3:DNA Encoding Output
%-------------------------------------------------------------------------
end