2D baker map code implementation
5 views (last 30 days)
Show older comments
I am trying to implement the discretized baker map for the shuffling of pixels,i am not able to understand the discretized version of it clearly.and neither am i able to implement it properly on matlab it always show index out of bounds error. here is the link http://link.springer.com/chapter/10.1007/978-3-540-95972-4_16 please can somebody help. I am a beginner and this is my effort at it i know it is pathetic but still.
for i=1:row
for j=1:col
if(1<=j<row/2)
newcord1=((2*(j-1))+mod(i-1,2));
newcord2=(floor(0.5*(i-mod(i-1,2))+1));
im(i,j)=im(newcord2,newcord1);
elseif(row/2 <=j <=row)
newcord1=((2*(j-64))+mod(i,2));
newcord2=floor(0.5*(i-mod(i,2))+63);
im(i,j)=im(newcord2,newcord1);
end
end
end
5 Comments
Zeina Abdullah
on 21 Feb 2022
Hi , please can you help me i need a chaotic interleaver code using baker map . please tell any thing can help me in my problem . @Parveiz Lone @su su maung @Syahirah Rahim @myetceteramail myetceteramail @Walter Roberson
Answers (1)
Walter Roberson
on 12 Jan 2017
if(1<=j<row/2)
means
if ((1<=j)<row/2)
The first part, 1<=j, returns false (0) or true (1). That 0 or 1 is then compared to row/2.
You probably want
if 1<=j && j<row/2
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!