Reshape an Matlab array
이전 댓글 표시
I have the following arrangement (84x2):
RELOADING_PATTERN = [...
26 24
26 35
27 34
27 33
26 33
25 34
25 35
...
] ;
How can I reshape the arrangement to (7x24)?. I tried the reshape function as follows but it doesn't work:
A = reshape(RELOADING_PATTERN(1:84,:),7,24);
I want to get the following array:
A = 26 24 28 24 ...
26 35 29 24 ...
27 34 29 33 ...
27 33 28 33 ...
26 33 27 34 ...
25 34 27 35 ...
25 35 29 34 ...
Thanks in advance.
댓글 수: 3
David Hill
2020년 12월 9일
You are reducing the number of elements by half. What do you want to do with the other half of the elements? Or do you want 7x24?
A=reshape(RELOADING_PATTERN,7,[]);
%or
A=reshape(RELOADING_PATTERN(:,1),7,[]);
Yro
2020년 12월 9일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!