How can I convert 2-D array to 1-D array.
조회 수: 4 (최근 30일)
이전 댓글 표시
I am using a variable oprtn_pts. whose size is 3 2.
I want to convert this into 6*1. How can I do this?
댓글 수: 0
채택된 답변
Andrei Bobrov
2012년 9월 18일
one way
out = oprtn_pts(:);
or
out = oprtn_pts.';
out = out(:);
other:
out = reshape(oprtn_pts,[],1);
or
out = reshape(oprtn_pts.',[],1);
댓글 수: 0
추가 답변 (1개)
Wayne King
2012년 9월 18일
편집: Wayne King
2012년 9월 18일
oprtn_pts = randn(3,2);
oprtn_pts = reshape(a,6,1);
It takes the elements from oprtn_pts columnwise.
댓글 수: 3
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!