I need to implement this code as chaotic interleaver by using baker map
2 views (last 30 days)
Show older comments
this code of the 2d chaotic interleaver using baker map
clc
clearvars
N=8;
X=vec2mat(1:N*N,N);
B=zeros(N);
Sk=[0 2 4 2];
[~,key]=size(Sk);
row=N;
col=N;
for s=0:row-1
Ni=0;
for i=1:key-1
Ni=Ni+Sk(i);
ni=Sk(i+1);
for r=Ni:Ni+ni-1
q=N/ni;
nrow=q*(r-Ni)+mod(s,q);
ncol=((s-mod(s,q))/q+Ni);
B(r+1,s+1)=X(nrow+1,ncol+1);
end
end
end
the output must be as shown :
31 23 15 7 32 24 16 8
63 55 47 39 64 56 48 40
29 21 13 5 30 22 14 6
61 53 45 37 62 54 46 38
27 19 11 3 28 20 12 4
59 51 43 35 60 52 44 36
25 17 9 1 26 18 10 2
57 49 41 33 58 50 42 34
but the real output in this code dosen't match the correct output please if any one have a solution to this problem i need to help and thank you to every one answer me
B
Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!