Deleting Triangulation Entries from a Delaunay Triangulation Based on Indices Given by a Logical Array

1 回表示 (過去 30 日間)
Hello,
I am using Delaunay Triangulations to map a 3D space. Given certain criteria, I select a certain number of points to be removed both from my coordinates vector and the triangulation matrix. I am using a logical array to define the coordinates vector indices to remove, now I want to use that directly to detect which rows of the triangulation contain those indices and delete them. A little example:
A = [1 2 3;4 5 6;7 8 9;10 11 12]; % Coordinate Matrix
bound = [5 3 3]; % Spatial Bounds
ids = bound(1,1) <= A(:,1) & bound(1,2) <= A(:,2) & bound(1,3) <= A(:,3); % logical operator
This code gives
ids = [0 0 1 1]
This means I can delete the coordinates not satistying my boundaries with
A(ids,:) = [];
But how can I search for the indices 3 and 4 (the one resulting from the logical operation) inside a big Triangulation matrix (of size n*4) and delete every row containing one of those indices? I obviously only care about rows.
Thanks
  2 件のコメント
the cyclist
the cyclist 2014 年 5 月 8 日
Are you saying that if
T = [1 2 6 7; 1 3 6 7; 1 4 6 7; 1 5 6 7];
you want to remove the second and third rows, because they contain the numbers 3 or 4?

サインインしてコメントする。

採用された回答

the cyclist
the cyclist 2014 年 5 月 8 日
If my comment above is a correct interpretation of what you want, then this code will do it:
T(any(ismember(T,find(ids)),2),:) = [];

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDelaunay Triangulation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by