Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

OUT oF MeMoRy

$
0
0
Helo friends! i m trying to perform column twist interleaving* on an array of 64800 bits. So, for that i wrote following code.
-----------------------------------------------------------------------------------------------------------
*Column Twist Interleaving: The input bit u_i with index i, for 0 ? i < 64800, is written to column c_i, row r_i of the interleaver, where:
c_i = floor(i/64799)
r_i = mod(5400,i+t)
where t = [0 0 2 2 3 4 4 5 5 7 8 9 ]
  for c_i = [1 2 3 4 5 6 7 8 9 10 11 12 ], respectively

I wrote some codes (i m also writing respective errors):
code 1)
------------------------------------------------------------------------------------------------------------
x = randi(1,64800);
for i = 0:64799;
    c = floor(i/5400);
    if c == 0 || c == 1
        t= 0;
    elseif c == 2 || c == 3
        t= 2;
    elseif c == 4
        t= 3;
    elseif c == 5 || c == 6
        t= 4;
    elseif c == 7 || c == 8
        t= 5;
    elseif c == 9
        t= 7;
    elseif c == 10
        t= 8;
    elseif c == 11
        t= 9;
    end
    r = i + mod(5400,(i+t));
    x(c+1,r+1) = u(i+1);
end
x
------------------------------------------------------------------------------------------------------------
ERROR :Error using randi
Out of memory. Type HELP MEMORY for your options.
------------------------------------------------------------------------------------------------------------
code 2)
for i = 0:64799;
    c = floor(i/5400)+1;
    t = t = [0 0 2 2 3 4 4 5 5 7 8 9]
    r = mod(5399,i+t(c)) + 1;
    x(r,c) = u(i);
end
x
------------------------------------------------------------------------------------------------------------
There was no error in second code. But output matrix was having elements only in 1st column and last row, all other elements of matrix were zeroes.

please someone having any other logic or idea please post.

Sincerely,

Viewing all articles
Browse latest Browse all 19628

Trending Articles