I have this function for scrambling DNA array in Matlab:
disp(x); disp(y);
figure,plot(x,y);
[lx,fx]=sort(x);
[ly,fy]=sort(y);
S=fx;
T=(fy)';
[Tgrid, Sgrid] = meshgrid( T, S );
W = arrayfun( @(S,T) [S T], Sgrid, Tgrid, 'UniformOutput', false );
D=cellfun(@(x) C{x(1),x(2)},W,'un',0);
disp(D);
I can't figure out how I can reverse this scrambled function to get the decryption code. Would you please help me up?
Edit//
I am working on a gray scale image encryption(256*256), converted the values of this image into dna array(265*265), every pixel have 4 characters for an example ACGT TTCG AAGC ....etc. After that i scrambled this dna array by using two generated random chaotic sequences x,y which the length of each other is (1*256).
This is the code from beginning to make the above part be more clear, hope you can help me to get the inverse of scrambled function:
clc
clear all
close all
tic;
A=imread('C:\Users\Desktop\lena.jpg');
disp(A);
imshow(A);
for i=1:1:256
for j=1:1:256
B{i,j,1} = dec2bin(A(i,j),8);
end
end
disp(B);
codebook1 = containers.Map({'00','11','10','01'},{'G','C','T','A'});
outputCell = cellfun(@(x) values(codebook1, {x(1:2),x(3:4),x(5:6),x(7:8)}),B, 'uni', 0);
C = cellfun(@cell2mat, outputCell, 'uni', 0);
disp(C);
a = 36;
b = 3;
c = 28;
d = 16;
k = 0.2;
v0 = [0.3 -0.4 1.2 1];
fun = @(t,v) chenAssistentFun(t,v,a,b,c,d,k);
[t, v] = ode45(fun, [0 1.54], v0);
x = v(:,1);
x(257)=[];
y = v(:,2);