Whats the difference between the two statements
조회 수: 4 (최근 30일)
이전 댓글 표시
Difference between
(reshape(key,2,[])')
and
reshape(key,2,[])
댓글 수: 0
답변 (2개)
Cris LaPierre
2020년 12월 13일
"Specify [] for the first dimension to let reshape automatically calculate the appropriate number of rows."
If you specify [] in the second dimention, it will automatically determine the appropriate number of columns for the specified number of rows.
댓글 수: 1
Cris LaPierre
2020년 12월 13일
Ah, missed the transpose (the apostrophe) after the first one. That transposes the results of reshape. It's probably just easiest to test it and see:
key = magic(4);
reshape(key,2,[])'
reshape(key,2,[])
Another way is to just swap the 2 and the [].
reshape(key,[],2)
Bruno Luong
2020년 12월 13일
The second creates 2-row matrix.
The first creates 2-column matrix, since it make a transpose after reshape.
참고 항목
카테고리
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!