필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Jay Hanuman
Jay Hanuman 2016년 11월 7일
댓글: Jay Hanuman 2016년 11월 7일
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(:).'
Jay Hanuman
Jay Hanuman 2016년 11월 7일
yes I run for 40 instead 4000 so it becomes 10*8.
iwant = iwant(:).'
works

댓글을 달려면 로그인하십시오.

카테고리

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