Making Matrix Dimensions Equal
조회 수: 2 (최근 30일)
이전 댓글 표시
Hey,
I have this cell with 12 different matrix. They are all of different size in length. How can I make all of them equal to 501 x 53 in size.
댓글 수: 5
채택된 답변
Guillaume
2019년 10월 28일
smallestwidth = min(cellfun('size', yourcellarray, 2)); %smallest width of all matrices in the cell array
newcellarray = cellfun(@(m) m(:, 1:smallestwidth), yourcellarray, 'UniformOutput', false); %crop all matrices inside the cell array to the smallest width
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!