Hello everyone,
I have an A matrix as
A=[a b ; c d ; e f ; g h]
and want to get B matrix as
B=[a ; b; c; d; e; f; g; h]
using A matrix. How can I code it? Thanks

 채택된 답변

per isakson
per isakson 2019년 6월 9일
편집: per isakson 2019년 6월 9일

0 개 추천

One way
z = permute( A, [2,1] );
B = z(:);
or
z = permute( A, [2,1] );
B = reshape( z, [],1 );

추가 답변 (2개)

TADA
TADA 2019년 6월 9일

0 개 추천

B = reshape(A',numel(A),1)

댓글 수: 1

Walter Roberson
Walter Roberson 2019년 6월 9일
A' is only correct for real valued entries, as it is the conjugate transpose.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

태그

질문:

2019년 6월 9일

댓글:

2019년 6월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by