필터 지우기
필터 지우기

how to find index a subset elements from a set of points

조회 수: 13 (최근 30일)
nadia nadi
nadia nadi 2016년 10월 5일
댓글: Raymond MacNeil 2019년 4월 24일
Dear,
I have this set of points.
Z =[23.46, 22.125, 22.308, 22.119, 21.098, 23.018, 20.356, 27.731, 26.388, 26.278; 21.138, 22.651, 21.256, 28.346, 24.288, 29.082, 24.21, 29.952, 23.362, 23.474]';
I found the index for Z then I select some subsets and I need to know their index from the set Z. is their any cheap idea please. I don't want to use some expensive code.
x1=[23.46, 22.125, 22.308;
21.138, 22.651, 21.256]';
x2=[21.098, 23.018, 20.356;
24.288, 29.082, 24.21]';
x3=[27.731, 26.388, 26.278;
29.952, 23.362, 23.474]';
many thanks

답변 (1개)

Walter Roberson
Walter Roberson 2016년 10월 5일
Use the second output of ismembertol or ismember
  댓글 수: 2
Walter Roberson
Walter Roberson 2016년 10월 5일
[tf, idx] = ismembertol(x1, z)
The location where tf is false were not found in z. The location where tf is true, the corresponding idx entry tells you where in Z it is
Raymond MacNeil
Raymond MacNeil 2019년 4월 24일
That is a great function! Thanks!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by