How to set elements in 2D matrix to zero given Index ?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
RuiQi
le 12 Juin 2017
Réponse apportée : Walter Roberson
le 12 Juin 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; ?
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!