You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
479 B
16 lines
479 B
%--------------------------
|
|
% @Author: Jingqiao Hu
|
|
% @Date: 2022-01-06 15:33:25
|
|
% @LastEditTime: 2022-01-08 17:37:20
|
|
|
|
% specifically for those repeated edges with opposite directions
|
|
%--------------------------
|
|
function [edges1, ia, ic] = unique_edges(edges0)
|
|
|
|
% remove repeated edges with opposite direction
|
|
e0(:,1) = mean(edges0(:,[1,3]), 2);
|
|
e0(:,2) = mean(edges0(:,[2,4]), 2);
|
|
[~, ia, ic] = uniquetol(e0, 'ByRows', true );
|
|
|
|
edges1 = edges0(ia,:);
|
|
end
|