I have a data matrix each for 100 persons.Initially I was dividing columns into four segments (see code below). Now this data matrix vary, instead of 10000, the columns have different lengths. How can i divide them into 4 segments?
조회 수: 1 (최근 30일)
이전 댓글 표시
data_10_col = data(:,[1:10000]);
for e = 1:4
epoch(e,:) = data_10_col(1+(e-1)*2500:e*2500);
end
댓글 수: 0
채택된 답변
KSSV
2018년 9월 3일
YOu can use reshape to achieve what you want.
A = rand(100,3) ; % 100 rows of some data
[nx,ny] = size(A) ;
B = reshape(A',ny,[],4) ;
iwant = permute(B,[2,1,3]);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!