Find values of row in matrix
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
will99
el 19 de Oct. de 2015
Respondida: TastyPastry
el 19 de Oct. de 2015
so I have matrix and index value I want to get all the values in the row I tried Find & ismember but I didn't get all the values in row 2
matrix = [8 81 82;20 22 23; 3 31 32];
index = 2
find(ismember(matrix,index),1);
1 comentario
Respuesta aceptada
TastyPastry
el 19 de Oct. de 2015
matrix(index,:);
ismember(A,B) returns a logical vector true when A is found in B, it doesn't apply here since you're not trying to create a logical mask.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!