Matrix manipulation by function
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Lila wagou
el 6 de Abr. de 2017
Comentada: Lila wagou
el 7 de Abr. de 2017
Dear all, For a given matrix (square) i need to eliminate some elements (some rows and columns)
A =
35 6 19
3 7 23
31 2 27
I need only the second (not the first and the third) row and column : the eliminated are stocked in a vector
B = (1 3)
So : some function (A, B) :::> the result C = 7
function (A, B) = C
2 comentarios
Respuesta aceptada
Andrei Bobrov
el 6 de Abr. de 2017
ii = num2cell([1;1]*setdiff(1:length(A),B(:)'),2);
out = A(ii{:});
8 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Operators and Elementary Operations 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!