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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Match function to return variable name

Casper123
3-Visitor

Match function to return variable name

Hello, 


I'm not that experience with Mathcad, I do with excel, there the index match function is quite handy, something similar I would like to use in Math

I would like a lookup function in a matrix, to return as output from the matrix, not the value, but the name:

Casper123_0-1654700037413.png

 

I'm not sure if it's even possible, have searched throughout the internet without results..

 

Thanks for helping!

ACCEPTED SOLUTION

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

Simplification.

We can get rid of the Index variable, but inline evaluation still is necessary because "max" cannot be evaluated symbolically if units are used.

Werner_E_0-1654875214576.png

 

 

View solution in original post

6 REPLIES 6

Hi,

Does this do:

Capture.JPG

LucMeekes
23-Emerald III
(To:Casper123)

Like this... (in Mathcad 2001)

LucMeekes_2-1654794434128.png

Unfortunately this functionality was lost in later versions of Mathcad, and Prime does not support it either,.

 

Success!
Luc

Werner_E
25-Diamond I
(To:LucMeekes)

Your method works if we use an intermediate variable for the index which is inline evaluated numerically to stop the symbolics from trying to recalculate it.

Werner_E_0-1654809393923.png

 

Werner_E
25-Diamond I
(To:Werner_E)

Simplification.

We can get rid of the Index variable, but inline evaluation still is necessary because "max" cannot be evaluated symbolically if units are used.

Werner_E_0-1654875214576.png

 

 

Thanks @Werner_E much appreciated. 
Learned something new again 🙂

Werner_E
25-Diamond I
(To:Casper123)


@Casper123 wrote:

Thanks @Werner_E much appreciated. 
Learned something new again 🙂


Me, too!
I wasn't aware that the symbolic evaluation of "max" would not work with units, even if we let Prime assume that all units are positive

Werner_E_0-1654875744614.png

 

Announcements

Top Tags