필터 지우기
필터 지우기

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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by