I don't understand what this u(:,1) does to matrix or vector?

36 Ansichten (letzte 30 Tage)
DM
DM am 27 Apr. 2015
Kommentiert: Stephen23 am 28 Apr. 2015
Hi
What does the following notation mean
u(:,1)
Does it covert a row vector to a column vector?
Thanks

Akzeptierte Antwort

pfb
pfb am 27 Apr. 2015
Bearbeitet: pfb am 27 Apr. 2015
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 Kommentare
DM
DM am 27 Apr. 2015
I have also come across the following notation x(:)? Do you know what it means?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by