How can delete specific value from the below matrix?

1 vue (au cours des 30 derniers jours)
Amir Torabi
Amir Torabi le 14 Déc 2019
Commenté : David Hill le 14 Déc 2019
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 commentaire
David Hill
David Hill le 14 Déc 2019
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).

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by