Find array row element in another index array
2 views (last 30 days)
Show older comments
Given two array Idx_of_pt and P, I'd like to find all the row element in P from Idx_of_pt
Idx_of_pt=[1 2 3;4 6 7;2 3 5];
P=[-0.03 0.12 0.04
-0.94 0.12 0.01
-0.06 0.15 0.037
-0.22 0.13 0.02
-0.26 0.12 0.07
-0.25 0.16 0.62
-0.37 0.17 0.19 ]
so the result should be [-0.03 0.12 0.04 ; -0.94 0.12 0.01 ; -0.06 0.15 0.037
-0.22 0.13 0.02 ; -0.25 0.16 0.62 ; -0.37 0.17 0.19
-0.94 0.12 0.01 ; -0.06 0.15 0.037 ; -0.26 0.12 0.07]
(they can form triangles)
Any elegant method ?
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!