use the mat2cell function
조회 수: 3 (최근 30일)
이전 댓글 표시
Now i have a 5*100 matrix, how to convert it to a 5*10 cell and each cell contain 1*10?
댓글 수: 0
답변 (2개)
David Hill
2021년 3월 23일
b=mat2cell(a,[1 1 1 1 1],[[10 10], [10 10], [10 10], [10 10], [10 10]]);
댓글 수: 0
Star Strider
2021년 3월 23일
Try this:
A = randi(9, 5, 100); % Create Matrix To Test Code
C = mat2cell(A, ones(5,1), ones(1,10)*10) % Desired Result
.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!