How can delete specific values from below matrix?

조회 수: 2 (최근 30일)
Amir Torabi
Amir Torabi 2019년 12월 14일
댓글: Amir Torabi 2019년 12월 15일
Hi.
I'd like to delete the columns from matrix distance which don't meet the condition inx.
Thanks.
for ig= 1:length(A)
distance(:,ig) = sqrt(abs(((A(:,1)-A(ig,1)).^2+(A(:,2)-A(ig,2)).^2)));
inx = distance>=50;
end

답변 (1개)

Dyuman Joshi
Dyuman Joshi 2019년 12월 15일
To delete elements(columns here) from a matrix(distance) that don't meet a condition (distance>=50), you can do this
distance(distance<50)=[];
  댓글 수: 1
Amir Torabi
Amir Torabi 2019년 12월 15일
Let me explain my goal clearly.
Inside the below image, you see several points. These are from matrix A included in the atrached file. I'd like to show just the points meet the condition (distance>50). It means i wanna show the points that have distance greater than 50 from each other in the image.
Thanks.
pic3.jpg

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by