Hot to locate indices of 2-D data located out of circle?
1 回表示 (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
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
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)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!