loop for extracting columns of a matrix
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Pedro Roda Navarro
el 21 de Abr. de 2015
Comentada: Pedro Roda Navarro
el 21 de Abr. de 2015
I would like to know how to do a loop to extract all the columns from a matrix and generate individual vectors
Thanks to all
2 comentarios
Adam
el 21 de Abr. de 2015
What are you going to do with the individual vectors when they are no longer in the matrix?
Almost certainly anything you want to do would be better off having them all within the matrix and run whatever your vector-based operation is in a for loop if it cannot be vectorised.
Respuestas (1)
Chris McComb
el 21 de Abr. de 2015
If you have a matrix, M, you can access column i (as a vector) by using M(:, i).
(The colon indicates 'every row')
Ver también
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!