Borrar filtros
Borrar filtros

extracting specific rows from a matrix

1 visualización (últimos 30 días)
Don Brohaugh
Don Brohaugh el 23 de Abr. de 2015
Comentada: Don Brohaugh el 23 de Abr. de 2015
If I have a 1080 x 4 matrix Y, arranged as:
value1 int int int
value2 int int int
value3 int int int
and so on for 1080 rows,
how do I extract all rows in the matrix with the integer in column 3, whose value is, say 11, and create a new 6 x 4 matrix Z of the six entries in Y with the integer 11 present in column 3?
Thank you,
Don

Respuesta aceptada

Guillaume
Guillaume el 23 de Abr. de 2015
Editada: Guillaume el 23 de Abr. de 2015
This is basic matrix indexing:
Z = Y(Y(:, 3) == 11, :);

Más respuestas (0)

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!

Translated by