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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Translate the entire conversation x

Replace values in a matrix with minimums for ranges based on a separate same size matrix in Mathcad.

RE_12882698
5-Regular Member

Replace values in a matrix with minimums for ranges based on a separate same size matrix in Mathcad.

This request is more fully explained in the attached file. The request is for a way to take two single column vectors or matrices that are effectively two columns of a table when augmented (i.e., namely matrix A and matrix B). The first matrix "A" has several rows that have repeated values. A function has been run to create a new matrix "C" that has removed the duplicate rows.

Please help to write a function that will create matrix "D" such that "D" contains the minimum values from the second matrix "B" pertaining to rows that had the same value in matrix A. Thus, matrix D ensures that removal of duplicate rows from A does not lose the minimum associated values in "B". I think the details in the attached Mathcad Prime 10 file will help clarify this request.   

ACCEPTED SOLUTION

Accepted Solutions

4 REPLIES 4

image.png

ttokoro_0-1739320040063.png

 

RE_12882698
5-Regular Member
(To:ttokoro)

Thank you. Very much appreciated.

Werner_E
25-Diamond I
(To:RE_12882698)

As an alternative here is an all-in-one utility function which creates the final matrix in one go - might come handy ...

Werner_E_0-1739321998713.png

 

 

RE_12882698
5-Regular Member
(To:Werner_E)

Thank you. This is also an excellent solution. I will use both this and the other solution posted in my calculation so that I can use one to check the other. Very much appreciated. Grateful for your help and yes, I am sure this will come in handy.  I also really appreciate the fact that you uploaded the Mathcad file.

Announcements

Top Tags