How to set elements in 2D matrix to zero given Index ?

6 visualizaciones (últimos 30 días)
RuiQi
RuiQi el 12 de Jun. de 2017
Respondida: Walter Roberson el 12 de Jun. de 2017
gt_regions = regionprops(gt,'PixelList');
linearInd = sub2ind(size(gt), gt_regions(1).PixelList(:,2), gt_regions(1).PixelList(:,1));
Now how do I use this to set the matrix elements to zero ?
ans = gt(linearInd) == 0; ?

Respuesta aceptada

Walter Roberson
Walter Roberson el 12 de Jun. de 2017
gt(linearInd) = 0;

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing 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