function reshape creating matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I need to use the reshape command to create a 3 × 4 matrix and fill it with the next values starting from 10.
A = 10:20;
B = reshape(A,[3,4])
I'm trying to do it with what command but I get an error: To RESHAPE the number of elements must not change. How to do it correctly?
댓글 수: 0
채택된 답변
Alan Stevens
2021년 3월 11일
"A" only has 11 elements. You want B to have 12 elements (3*4). If you set A = 10:21, for example, it will work.
댓글 수: 0
추가 답변 (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!