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
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
Solved! Go to Solution.
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.
Mathcad Prime Express 7 worksheet attached.
Stuart
Hi,
Or, in one go, and irrespective of the value of ORIGIN:
Prime4 file attached.
Success!
Luc
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.
Mathcad Prime Express 7 worksheet attached.
Stuart
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:
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).
(the image is just a continuation of the OP's original)
Stuart
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?
@MichaelW wrote:
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?
On the surface, I agree that it would appear closed.
However, I'm always curious as to what the source of the problem is. For example, why the max of the first 3 of 20 items, and why "matrix" instead of "vector"? Sometimes, there's a bit more to the story that can invalidate the proposed solutions or make them just a subset - eg, the user might want to specify a column of a matrix or realize they need the location of the item as well.
Stuart