How to copy rows of a matrix to convert it into single row??

조회 수: 3 (최근 30일)
Maruti Patil
Maruti Patil 2016년 4월 6일
답변: Star Strider 2016년 4월 6일
Suppose I have got A=[1 2; 3 4; 5 6; 7 8]
Now I want output as B=[1 2 3 4 5 6 7 8]
How to do this?
Thanx

채택된 답변

Star Strider
Star Strider 2016년 4월 6일
Use the reshape function:
A=[1 2; 3 4; 5 6; 7 8];
B = reshape(A', 1, [])
B =
1 2 3 4 5 6 7 8

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by