Separating blocks of data question

조회 수: 1 (최근 30일)
m j
m j 2021년 9월 8일
답변: Walter Roberson 2021년 9월 8일
Hello,
I have an Array = 1 X 991232. Inside this array I have 2 sets of data alternating between 8192 blocks of data.
So data in array is like...
Ch1 = Array[1:8192]
Ch2 = Array[8193:16385]
Ch1 = Array[16386:24578]
Ch2 = Array[24579:32770]
etc.....
I could probably make a for loop and seperate and concatenate but I was wondering if there was a simpler way to seperate ch1 and ch2 into seperate arrays,so at end I'd have 2 arrays?

답변 (1개)

Walter Roberson
Walter Roberson 2021년 9월 8일
temp = reshape(Array, 8192, []);
Ch1 = reshape(temp(:,1:2:end), 1, []);
Ch2 = reshape(temp(:,2:2:end), 1, []);

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by