How do I turn a nxm matrix into a single array?
이전 댓글 표시
hi Matlabers,
say I have a matrix
[1 2 3 4;5 6 7 8;9 10 11 12; 13 14 15 16]
how can I turn this matrix so all the rows are combined into one. one after the other.
result
[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]?
thanks in advance. cheers SN
채택된 답변
추가 답변 (1개)
manoj saini
2012년 10월 17일
0 개 추천
to exact answer >>b=reshape(a',1,16) because matlab always prefer coloum element so pass a'(a transpose) for your exact output
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!