cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Translate the entire conversation x

Vector with two columns

NM_10165576
13-Aquamarine

Vector with two columns

How to apply this program, when the vector has two columns.

NM_10165576_0-1738670586102.png

 

Reference topic: https://community.ptc.com/t5/Mathcad/How-to-remove-duplicate-entries-in-an-array-using-a-program/m-p/996692 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:NM_10165576)


@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:

Werner_E_0-1738687859334.png

Of course it does not only work on two column matrices

Werner_E_1-1738687923326.png

but for matrices of all dimensions

Werner_E_2-1738687981441.png

and so also for vectors (= 1-column matrices) as well 😉

Werner_E_4-1738688167989.png

 

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.

Werner_E_0-1738689277696.pngWerner_E_1-1738689307673.png

 

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":

Werner_E_0-1738691139953.png

NaN is also not seen as a scalar which is why "match" fails and thats the reason for the "matchNaN" function

Werner_E_1-1738691298423.png

 

 

 

 

Prime 10 sheet attached

View solution in original post

4 REPLIES 4

Please enclose your worksheet?

Werner_E
25-Diamond I
(To:NM_10165576)


@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:

Werner_E_0-1738687859334.png

Of course it does not only work on two column matrices

Werner_E_1-1738687923326.png

but for matrices of all dimensions

Werner_E_2-1738687981441.png

and so also for vectors (= 1-column matrices) as well 😉

Werner_E_4-1738688167989.png

 

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.

Werner_E_0-1738689277696.pngWerner_E_1-1738689307673.png

 

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":

Werner_E_0-1738691139953.png

NaN is also not seen as a scalar which is why "match" fails and thats the reason for the "matchNaN" function

Werner_E_1-1738691298423.png

 

 

 

 

Prime 10 sheet attached

NM_10165576
13-Aquamarine
(To:Werner_E)

This program works. Thank you for the reply.

Werner_E
25-Diamond I
(To:NM_10165576)


@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.

Announcements

Top Tags