Removing data points that are out of a specific boundary

조회 수: 36 (최근 30일)
Sean
Sean 2014년 7월 7일
답변: Sara 2014년 7월 7일
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)?

채택된 답변

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by