Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
How to apply this program, when the vector has two columns.
Reference topic: https://community.ptc.com/t5/Mathcad/How-to-remove-duplicate-entries-in-an-array-using-a-program/m-p/996692
Solved! Go to Solution.
@NM_10165576 wrote:
How to apply this program, when the vector has two columns.
If the "vector" has two columns, its no longer a vector but a general matrix 🙂
Reference topic: https://community.ptc.com/t5/Mathcad/How-to-remove-duplicate-entries-in-an-array-using-a-program/m-p/996692
Somehow your link refers back to this very thread which sure was not intended.
I guess you meant this thread: Solved: How to remove duplicate entries in an array using ...
The "match" functions only works with a scalar value as its first argument (the value match should look for) and so the variante offered in that thread don't work.
You may use a simple straight forward solution to remove duplicate rows from a matrix:
Of course it does not only work on two column matrices
but for matrices of all dimensions
and so also for vectors (= 1-column matrices) as well 😉
Remark; I assumed that you wanted to remove duplicate rows of a matrix.
If your intention was to remove rows with duplicate values in just one column (maybe the first column) - disregarding the values in the other columns, you sure could use a program similar to the ones provided in the thread you intended to link to.
BTW, none of the version would work OK if the matrix contains NaN's, because you can't check NaN's for equality - the result would always be "not equal":
NaN is also not seen as a scalar which is why "match" fails and thats the reason for the "matchNaN" function
Prime 10 sheet attached
Please enclose your worksheet?
@NM_10165576 wrote:
How to apply this program, when the vector has two columns.
If the "vector" has two columns, its no longer a vector but a general matrix 🙂
Reference topic: https://community.ptc.com/t5/Mathcad/How-to-remove-duplicate-entries-in-an-array-using-a-program/m-p/996692
Somehow your link refers back to this very thread which sure was not intended.
I guess you meant this thread: Solved: How to remove duplicate entries in an array using ...
The "match" functions only works with a scalar value as its first argument (the value match should look for) and so the variante offered in that thread don't work.
You may use a simple straight forward solution to remove duplicate rows from a matrix:
Of course it does not only work on two column matrices
but for matrices of all dimensions
and so also for vectors (= 1-column matrices) as well 😉
Remark; I assumed that you wanted to remove duplicate rows of a matrix.
If your intention was to remove rows with duplicate values in just one column (maybe the first column) - disregarding the values in the other columns, you sure could use a program similar to the ones provided in the thread you intended to link to.
BTW, none of the version would work OK if the matrix contains NaN's, because you can't check NaN's for equality - the result would always be "not equal":
NaN is also not seen as a scalar which is why "match" fails and thats the reason for the "matchNaN" function
Prime 10 sheet attached
This program works. Thank you for the reply.
@NM_10165576 wrote:
This program works. Thank you for the reply.
Fine, you are welcome.
If you don't have any further questions to this topic you may consider closing the thread.