matrix row extraction in
조회 수: 1 (최근 30일)
이전 댓글 표시
I have to seperate each 16 elements in a 128x1 matrix.In what way i can do this without using loops
댓글 수: 0
답변 (1개)
Akira Agata
2018년 3월 19일
Like this?
% Sample 128-by-1 vector
x = (1:128)';
% Solution-1:
nSeg = numel(x)/16;
A = mat2cell(x,repmat(16,1,nSeg),1);
Another possible solution:
% Solution-2:
B = reshape(x,16,[]); % Each column is 16-element segment
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!