フィルターのクリア

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

3 ビュー (過去 30 日間)
RuiQi
RuiQi 2017 年 6 月 12 日
回答済み: Walter Roberson 2017 年 6 月 12 日
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; ?

採用された回答

Walter Roberson
Walter Roberson 2017 年 6 月 12 日
gt(linearInd) = 0;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by