How can delete specific value from the below matrix?

1 回表示 (過去 30 日間)
Amir Torabi
Amir Torabi 2019 年 12 月 14 日
コメント済み: David Hill 2019 年 12 月 14 日
Hi.
I'd like to delete the columns in the matrix A which don't meet the condition inx.Also, in matrix distance, And update the matrix A to a new matrix.
MAtrix A, contains coordinates. And the distance of each row was calculated from all of other coordinates and stored into the distance matrix.
Thanks.
load A;
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 件のコメント
David Hill
David Hill 2019 年 12 月 14 日
Your question is quite confusing. Do you only want to remove coordinate rows of A where all distances between a coordinate and all other coordinates is <50? Otherwise, it does not make sense to me. You said delete columns of A not meeting the condition, but there are only two columns. You must mean to delete rows of A not meeting the condition (I assume that the coordinates in a particular row of A are always less than a distance of 50 between all the other coordinates).

サインインしてコメントする。

回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by