divide different data in parts and put it in one after another

1 次查看(过去 30 天)
I have data A=4000 length, b=4000 length. I want to divide A in 4 parts with each part 1000 and same thing with B. then I want to put divided data of A and B one after another so to make single row i.e. C=[ 1000(A) 1000(B) 1000(A) 1000(B) 1000(A) 1000(B) 1000(A) 1000(B)]. how to do it

回答(1 个)

KSSV
KSSV 2016-11-7
A1 = reshape(A,1000,4);
B1 = reshape(B,1000,4);
iwant = zeros(1000,8);
iwant(:,1:2:end)=A1;
iwant(:,2:2:end)=B1;
  3 个评论
Jan
Jan 2016-11-7
编辑:Jan 2016-11-7
@Ram: Really a 10x8 matrix? You mean 1000x8, don't you? Simply append:
iwant = iwant(:).'

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by