I don't understand what this u(:,1) does to matrix or vector?
39 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi
What does the following notation mean
u(:,1)
Does it covert a row vector to a column vector?
Thanks
0 comentarios
Respuesta aceptada
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
Stephen23
el 28 de Abr. de 2015
The syntax x(:) creates a column vector out of x, regardless of the shape of x. Here is some documentation and examples:
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!