Find the rows have two same elements from a matrix
显示 更早的评论
I have a matrix (each row represents a traingle and each element represents a vertex ID of that traingle), I want to find which two traingles have two same vertices. This question can be demonstrated by the following example, for a matrix like the following:
1 9 8
2 7 8
5 8 9
6 5 4
7 3 8
5 4 8
the output would be [1, 3], [2, 5], and [3, 6], which are the rows have two same elements.
3 个评论
Image Analyst
2022-12-11
What does each row and each column represent? Are you having triangles in 3-D, like (x, y, z)?
This looks like a homework problem. If you have any questions ask your instructor or read the link below to get started:
Obviously we can't give you the full solution because you're not allowed to turn in our code as your own.
Jiafeng Ye
2022-12-11
Torsten
2022-12-11
A research is no homework ? Then you don't work at home for your research ?
采纳的回答
更多回答(1 个)
Use edges to get a list of all the edges of the triangulation. Then loop over the list and use edgeAttachments.
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!