Reduce size of multidimensional array
조회 수: 10 (최근 30일)
이전 댓글 표시
Hello,
I have a multidimensional array size = 220 x 46 x 10 x 4 x2 . I would like to combine all of the data in the third dimension so that way I end up with a 4-dimesional array. Any help is greatly appreciated.
Take care and stay well!
댓글 수: 0
채택된 답변
James Tursa
2021년 2월 8일
One way using summing:
result = squeeze(sum(your_array,3));
댓글 수: 7
James Tursa
2021년 2월 9일
Yes. Reshape does not change the order of the data in memory. You will often need to use another function first such as permute or transpose etc. to rearrange the data in memory before applying the reshape.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!