Skip to main content
1-Visitor
January 11, 2024
Solved

Min/Max at each index between 2 matricies

  • January 11, 2024
  • 2 replies
  • 2278 views

I am trying to find the min/max value at each index across 2 matricies.

The min/max function finds the smallest/largest value across both matricies at every index, which is not what i want.. PNG and mathcadfile attached for clarity. I am using mathcad prime 9.0.0.0. I have tried several syntaxes (shown in the attachment), but to no luck.

 

Does anyone know the syntax for this?

 

Cheers,

Sebastian

Best answer by ttokoro

image.pngimage.pngimage.png

2 replies

ttokoro
21-Topaz I
ttokoro21-Topaz IAnswer
21-Topaz I
January 11, 2024

image.pngimage.pngimage.png

t.t.
1-Visitor
January 11, 2024

Thank you for your swift reply! It seemed that calling out i was the issue 🙂

25-Diamond I
January 11, 2024

The built-in function "min" and "max" can't be vectorized, but you can define your own Min/Max functions based on the built-in ones and call these vectorized:

Werner_E_0-1704977422920.png

 

1-Visitor
January 11, 2024

Is there an easy function or setting to make the answer come out as a 5x1 matrix, rather than a 1x5?

25-Diamond I
January 11, 2024

@SW_10829970 wrote:

Is there an easy function or setting to make the answer come out as a 5x1 matrix, rather than a 1x5?


The answer actually IS a 5 x 1 matrix (5 rows, 1 column).

If you would rather like to see it as a row vector (1 x 5 matrix), simply use the Transpose operator.

Werner_E_0-1705009489994.png