fid = fopen("sequence_long2.txt",'r');
C = textscan(fid,'%3s');
x = C{1}
fclose(fid);
ss = 1;
es = 183479;
seq_id = long_codon(x(ss:es));
function seq = long_codon(v)
seq = (v);
for pos = 1:length(seq)
if strcmp(seq{pos},'TAC')
index = find(strcmp(v,seq{pos}));
StartPos = index;
elseif (strcmp(seq{pos},'ACT') || strcmp(seq{pos},'ATT') || strcmp(seq{pos},'ATC'))
index = find(strcmp(v,seq{pos}));
EndPos = index;
end
end
fid2 = fopen('report_long.txt','w+');
fprintf(fid2,'Name: OP \n');
fprintf(fid2,'Lab 13: DNA Pattern Matching\n \n');
fprintf(fid2,'Start Position of Gene is: %d \n',StartPos);
fprintf(fid2, 'End Position of Gene is: %d \n',EndPos);
fclose(fid2);
end
14 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1162733
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1162733
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1163543
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1163543
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1165668
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1165668
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1165778
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1165778
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1165823
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1165823
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1165863
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1165863
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1165873
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1165873
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1165968
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1165968
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1166033
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1166033
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1166058
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1166058
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1166088
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1166088
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1166138
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1166138
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1166503
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1166503
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1167978
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/662603-how-can-i-save-the-beginning-and-end-positions-of-each-sequence-in-a-cell-array#comment_1167978
Sign in to comment.