how i can change column vector into row vector??
38 次查看(过去 30 天)
显示 更早的评论
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
2024-6-23,18:42
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.
Stephen23
2024-6-23,20:10
"Simply apply the transpose operator (')..."
' is the operator for complex conjugate transpose: https://www.mathworks.com/help/matlab/ref/ctranspose.html
回答(1 个)
Torsten
2024-6-23,18:40
编辑:Torsten
2024-6-23,18:41
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'
n.'
To change the column vector into the original row vector, use .' again:
n = [1 2 3 4 5];
n.'
(n.').'
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!