I don't understand what this u(:,1) does to matrix or vector?
조회 수: 39 (최근 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!