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

 Respuesta aceptada

pfb
pfb el 27 de Abr. de 2015
Editada: pfb el 27 de Abr. de 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 comentarios

DM
DM el 27 de Abr. de 2015
thanks, By array you mean a matrix right?
pfb
pfb el 27 de Abr. de 2015
Editada: pfb el 27 de Abr. de 2015
yes.
Note that u' and transpose(u) have different effects for complex numbers.
DM
DM el 27 de Abr. de 2015
I have also come across the following notation x(:)? Do you know what it means?
The syntax x(:) creates a column vector out of x, regardless of the shape of x. Here is some documentation and examples:

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

DM
el 27 de Abr. de 2015

Comentada:

el 28 de Abr. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by