필터 지우기
필터 지우기

Hot to locate indices of 2-D data located out of circle?

조회 수: 6 (최근 30일)
Abdulaziz Abutunis
Abdulaziz Abutunis 2019년 11월 17일
댓글: Abdulaziz Abutunis 2019년 11월 18일
Dear All,
I have x,y data that are extracted from a triangle solution. I wonder if there is a command (no loop) that will find the indices of elements when x^2+y^2 > than a specific value. The reason I want to eliminate them.
Thank you
Aziz

채택된 답변

Walter Roberson
Walter Roberson 2019년 11월 17일
vector_of_y_values = (1:number_of_rows) - y_center;
vector_of_x_values = (1:number_of_columns) - x_center;
[Yg, Xg] = ndgrid(vector_of_y_values, vector_of_x_values);
idx = find(Xg.^2 + Yg.^2 > specific_value);
  댓글 수: 4
Walter Roberson
Walter Roberson 2019년 11월 17일
I forgot to account for possible scale factors such as the possibility that the x coordinates are percentage. The x and y vectors should be constructed so that they list the x and y coordinates, such
linspace(firstx, lastx, number of x)
Abdulaziz Abutunis
Abdulaziz Abutunis 2019년 11월 18일
Thank you, Walter, for your valuable suggestions

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by