Creating vector from a matrix

3 visualizaciones (últimos 30 días)
Berkay
Berkay el 29 de Ag. de 2022
Comentada: Chunru el 30 de Ag. de 2022
I want to create a column vector from every second element of the matrix
how can I do it?

Respuestas (1)

Chunru
Chunru el 29 de Ag. de 2022
Editada: Chunru el 30 de Ag. de 2022
A = randn(3:4)
A = 3×4
-1.8158 0.3369 1.9546 0.1616 -0.6009 -0.4416 -0.0984 1.6391 3.4299 -0.4452 -0.7799 1.4173
v = A(1:2:end)'
v = 6×1
-1.8158 3.4299 -0.4416 1.9546 -0.7799 1.6391
  2 comentarios
Berkay
Berkay el 30 de Ag. de 2022
Yes That's what I want but how can I write this vector as column vector?
Chunru
Chunru el 30 de Ag. de 2022
Use " ' ". See above.

Iniciar sesión para comentar.

Categorías

Más información sobre Logical 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!

Translated by