Skip to main content
14-Alexandrite
December 22, 2020
Solved

Mathcad - match function

  • December 22, 2020
  • 2 replies
  • 3825 views

Hello everyone!

I have a problem with the following case:

 

I used the function Match (value, vector, "near") to find the row in which the vector has the wanted value.

 

But instead of finding a one value, I would like to create a function that would find a series of rows (Please see the attachment) But the function I created does not do the trick. I would appreciate any help

Murarz_0-1608631083318.png

 

 

 

Best answer by LucMeekes

It's not clear what you are after.

LucMeekes_0-1608638895630.pngLucMeekes_1-1608638917891.pngLucMeekes_2-1608638936709.png

Success!

Luc

2 replies

Murarz14-AlexandriteAuthor
14-Alexandrite
December 22, 2020

Sorry, already solved it. Forgot to put "|Match |"

Murarz14-AlexandriteAuthor
14-Alexandrite
December 22, 2020

But having defined the vector ff which considers the specific rows where values from vectror d match vector f. Is it possible to create a new vector c which would have rows as those defined in vector ff ?

 

In other words the first row of vector c : C_0 would be equal to C_ff0, where ff_0 is the first row of vector ff.,

C_1 would be equal to C_ff_1, C_2 equal to C_ff_2 and so on

LucMeekes23-Emerald IVAnswer
23-Emerald IV
December 22, 2020

It's not clear what you are after.

LucMeekes_0-1608638895630.pngLucMeekes_1-1608638917891.pngLucMeekes_2-1608638936709.png

Success!

Luc

25-Diamond I
December 22, 2020

Here is an utility function which does the job using vectorization:

Werner_E_0-1608668254672.png

 

For more flexibility you may add the string modifier ("near" in this case) as third function argument of "MatchIt".

 

 

Murarz14-AlexandriteAuthor
14-Alexandrite
December 22, 2020

Thank you !!