Removing data points that are out of a specific boundary

10 vues (au cours des 30 derniers jours)
Sean
Sean le 7 Juil 2014
Réponse apportée : Sara le 7 Juil 2014
If I have a matrix of xy coordinates A where A is something like
A= [1 2
3 4
3 0
10 1
3 11
5 6
.
.
.
x y ]
and I want to remove all data entry points where x>5, and y>4. How might I do that effectively without previous knowledge of the entries (i.e. x and y = 10*rand(n,1) or something)?

Réponse acceptée

Sara
Sara le 7 Juil 2014
[i,~] = find(A(:,1) > 5 & A(:,2) < 4);
A(i,:) = []

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by