How to delete elements considered in a loop?

조회 수: 2 (최근 30일)
Christopher Ibeh
Christopher Ibeh 2019년 2월 6일
편집: Star Strider 2019년 2월 6일
Please in matching values of two similar arrays using a for loop, how do I delete elements that meet the matching criteria for an element in the reference array so its mot matched twice.

답변 (1개)

Star Strider
Star Strider 2019년 2월 6일
I am not certain what you are doing or what your arrays are. However, the ismembertol (link) function is likely the function that will do what you want. Let it do the looping and duplicate checking.
  댓글 수: 3
Star Strider
Star Strider 2019년 2월 6일
편집: Star Strider 2019년 2월 6일
In the documentation discussion on 'DataScale', the ‘A’ and ‘B’ arrays both have 2 columns. It appears that your arguments have different column sizes that that, so a 2-element 'DataScale' vector is not appropriate. Your 'DataScale' value vector has to have the same number of columns as your data. If you want to use 'DataScale' with vectors, use the method in the documentation section on Specify Absolute Tolerance (link).
EDIT — (6 Feb 2019 at 20:28)
I still don’t know what you are doing, however investigate the setdiff (link) and intersect (link) functions to see if they will do what you want.
Christopher Ibeh
Christopher Ibeh 2019년 2월 6일
I appreciate your response.
But for the nature of data i have, there are two arrays of 12 columns each. The colums contain particle coordinates and properties.
I intend to match the rows on one array to corresponding rows of the other array, with tolerance value for some of the atributes as conditions for a match.
Please, can i achieve this with ismembertol? or do you know of a better way i can achieve it?
Thanks

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

카테고리

Help CenterFile Exchange에서 Data Preprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by