how i can change column vector into row vector??

n = [1 2 3 4 5]
n =
1 2 3 4 5
>> r = n'
r =
1
2
3
4
5
Then i want to change into row vector again??

댓글 수: 2

Aditya
Aditya 2024년 6월 23일
To convert a column vector back into a row vector, use the transpose operation. Simply apply the transpose operator (') to the column vector to obtain the row vector.
"Simply apply the transpose operator (')..."
' is the operator for complex conjugate transpose: https://www.mathworks.com/help/matlab/ref/ctranspose.html

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

답변 (1개)

Torsten
Torsten 2024년 6월 23일
편집: Torsten 2024년 6월 23일
Simply converting a row vector into a column vector needs the usual transpose operator which is .' You used only ' with is conjugate transpose. This will make a difference if the elements of the vector are complex numbers:
n = [1+1i,2-0.5*1i];
n'
ans =
1.0000 - 1.0000i 2.0000 + 0.5000i
n.'
ans =
1.0000 + 1.0000i 2.0000 - 0.5000i
To change the column vector into the original row vector, use .' again:
n = [1 2 3 4 5];
n.'
ans = 5x1
1 2 3 4 5
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
(n.').'
ans = 1x5
1 2 3 4 5
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2024년 6월 23일

댓글:

2024년 6월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by