I don't understand what this u(:,1) does to matrix or vector?
38 次查看(过去 30 天)
显示 更早的评论
Hi
What does the following notation mean
u(:,1)
Does it covert a row vector to a column vector?
Thanks
0 个评论
采纳的回答
pfb
2015-4-27
编辑:pfb
2015-4-27
It gives you the first column of the array u.
If u is a row vector, that is the 1st element.
if u is a column vector, that is the entire vector.
If you want to transform a row vector into a column, see u', transpose(u), or u(:).
4 个评论
Stephen23
2015-4-28
The syntax x(:) creates a column vector out of x, regardless of the shape of x. Here is some documentation and examples:
更多回答(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!