question about matrix interleavers??

how to interleave a matrix and deinterleave it?? so it gets back to its original state?

3 件のコメント

the cyclist
the cyclist 2013 年 5 月 26 日
I suggest you give more detail and/or a small example of what you mean. I, for one, don't understand specifically what you mean by "interleave".
mary
mary 2013 年 5 月 26 日
interleaver: it rearrange or reshape the matrix deinterleaver : it restores the original arrangement of the maatrix
Image Analyst
Image Analyst 2013 年 5 月 26 日
That's no answer.

サインインしてコメントする。

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 26 日

0 投票

you can use reshape function. give an example of matrices you want to interleave

9 件のコメント

mary
mary 2013 年 5 月 26 日
i don't know how do interleavers work. i only know how to implement matrix transpose..
could you give any example about any type of interleavers?
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 26 日
% Example
A=[1 2 0;3 4 0;5 6 0];
B=10*A+100
% the code
Result=reshape([A(:) B(:)]',2*size(A,1), [])
Image Analyst
Image Analyst 2013 年 5 月 26 日
mary, do your matrices all have the same number of rows and columns? Do you want to interleave by rows or by columns? Please give an example of the most general case.
mary
mary 2013 年 5 月 26 日
it has the same number of rows and columns, and i want to interleave by rows.
the only case i know is:
a=[1 1 1;2 2 2;3 3 3];
after being interleaved will be:[1 2 3;1 2 3;1 2 3]
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 26 日
This is transposition
out=a'
mary
mary 2013 年 5 月 26 日
and i only have one matrix that i want to change its order. i dont want to combine 2 matrices.
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 26 日
How do you want to change it?
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 26 日
There are many function to change your matrix
flipud
fliplr
rot90
circshift
mary
mary 2013 年 5 月 26 日
i will try these .. thank you indeed

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2013 年 5 月 26 日

0 投票

Not sure what you mean, but here's one way/interpretation:
m1 = magic(6)
m2 = ones(10, 6)
columns = size(m1, 2)
m1Rows = size(m1, 1)
m2Rows = size(m2, 1)
m3 = zeros(m1Rows+m2Rows, columns);
% Interleave. If there's any difference in the number of rows,
% the mismatching rows will be zero.
% You could handle that differently if you want to,
% for example, just append the remaining rows
% of the taller array.
for row = 1 : max([m1Rows, m2Rows])
m3Row = 2 * (row-1)+1;
if row <= m1Rows
m3(m3Row, :) = m1(row, :);
end
if row <= m2Rows
m3(m3Row+1, :) = m2(row, :);
end
end
m3

カテゴリ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by