Borrar filtros
Borrar filtros

selection of particular rows from a matrix?

2 visualizaciones (últimos 30 días)
minu s
minu s el 23 de Oct. de 2016
Comentada: michio el 24 de Oct. de 2016
I would like to select rows from a matrix in a particular pattern as: row nos 1,2,3,5,6,7,9,10,11,13 and so on. Please help me in coding the loop.

Respuestas (1)

michio
michio el 23 de Oct. de 2016
Editada: michio el 23 de Oct. de 2016
ismember function could do the work with 'rows' option.
Please check the example code with 'rows' option on the doc page.
  1 comentario
michio
michio el 24 de Oct. de 2016
Very simple sample code follows.
A = [1,2,3; 2,3,1; 3,1,2];
B = [2,3,1];
idx = ismember(A,B,'rows')
A(idx,:)

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by