MATLAB Answers

0

Divide the shuffled sequence Q={Q1,Q2,Q3,···,Qm×n}. into MN/16 matrices which are 4×4. M=256 and N=256

Asked by Sultan Mehmood on 28 Jun 2019
Latest activity Answered by Jan
on 28 Jun 2019
Accepted Answer by Jan
x=0.3;
p=0.343;
for n=2:65536;
if x(n-1)>=0 & x(n-1)<=p
x(n)=x(n-1)/p;
else
x(n)=(1-x(n-1))/(1-p);
end
end
A=sort(x);
[A,T]=sort(x);
Q=R(T);
whats next.? thanks in advance.

  1 Comment

I've formatted your code today. Please do this by your own using the toolbar on top of the section for editing the message.

Sign in to comment.

1 Answer

Answer by Jan
on 28 Jun 2019
 Accepted Answer

Replace
A=sort(x);
[A,T]=sort(x);
Q=R(T);
by
Q = Q(randperm(65536, 65536));
Then:
Q4 = reshape(Q, 4, 4, numel(Q)/16)
Now Q4(:, :, n) is the n.th matrix.

  0 Comments

Sign in to comment.