Skip to main content
1-Visitor
January 28, 2022
Solved

Finding the Max Value from Part of a Matrix

  • January 28, 2022
  • 6 replies
  • 8916 views

Please see the attached file. I need a simple and elegant solution for finding the max value from part of a single column matrix. Thanks

JJ_9094500_0-1643366753873.png

 

Best answer by StuartBruff

Here are some variants on the answers already given plus an additional one that allows you to choose whichever elements you want from A.

 

Note that the functions were written in Mathcad Prime Express 7.  Express does not have programming and so breaks a function down into a sequence of successive (functional) steps.

 

StuartBruff_0-1643391811477.png

 

StuartBruff_1-1643391869900.png

StuartBruff_3-1643392064988.png

 

 

Mathcad Prime Express 7 worksheet attached.

 

Stuart

 

 

 

 

6 replies

ttokoro
21-Topaz I
21-Topaz I
January 28, 2022
24-Ruby III
January 28, 2022

Hi,

MartinHanak_0-1643377767233.png

 

23-Emerald IV
January 28, 2022

Or, in one go, and irrespective of the value of ORIGIN:

LucMeekes_1-1643381972237.png

Prime4 file attached.

 

Success!
Luc

 

12-Amethyst
January 28, 2022
23-Emerald V
January 28, 2022

Here are some variants on the answers already given plus an additional one that allows you to choose whichever elements you want from A.

 

Note that the functions were written in Mathcad Prime Express 7.  Express does not have programming and so breaks a function down into a sequence of successive (functional) steps.

 

StuartBruff_0-1643391811477.png

 

StuartBruff_1-1643391869900.png

StuartBruff_3-1643392064988.png

 

 

Mathcad Prime Express 7 worksheet attached.

 

Stuart

 

 

 

 

17-Peridot
February 8, 2022

Hello, I can confirm that submatrix() and programs are applicable and are the intended approach.

 

However, getting back to initial request to "simple and elegant solution": Utilizing simple Mathcad definition capabilities, please compare this:

 

23-Emerald V
February 8, 2022

See the second line in my response - the shuffle was just there to randomize the data for test purposes (and provide a function that is potentially useful in other circumstances).  

 

https://community.ptc.com/t5/PTC-Mathcad/Finding-the-Max-Value-from-Part-of-a-Matrix/m-p/775291/highlight/true#M199539

 

(the image is just a continuation of the OP's original)

 

Stuart

17-Peridot
February 8, 2022

Well I see. Thank you for the reminder.

Seems that the initial post caused a lot of elegant and other related solutions.

I'd say that this solves the issue anyway.

What you think?