Skip to main content
1-Visitor
June 17, 2014
Solved

Absolute value of each entry in a vector?

  • June 17, 2014
  • 3 replies
  • 13926 views

In MathCAD 14 I am attempting to find the maximum absolute value in a vector that contains positive and negative numbers. With only positve numbers in the vector this works to determine the maximum value:

max(vector)=

With positive and negative values I have tried putting the vector in absolute value bars within the max function like this:

max([vector])=

but the answer is strange and is larger than the aboslute value of any of the entrys in the vector (maybe it's finding the determinant?).

How can a command be written to find the maximum of all the absolute values in a vector?

Best answer by AlanStevens

Just vectorise the absolute value calculation. e.g.

vectorise.PNG

Use the f(M) with the arrow over it to vectorise. You can then put the vectorised absolute values into the max() function.

Alan

3 replies

19-Tanzanite
June 17, 2014

Just vectorise the absolute value calculation. e.g.

vectorise.PNG

Use the f(M) with the arrow over it to vectorise. You can then put the vectorised absolute values into the max() function.

Alan

1-Visitor
June 18, 2014

Werner gives a good explanation on implicit and explicit vectorisation in the following thread which may help.

http://communities.ptc.com/message/245740#245740

dsochor1-VisitorAuthor
1-Visitor
May 15, 2017

This solution works in Mathcad 14 but not prime. Is there a simple way to create a vector of the absolute values of another vector?

24-Ruby IV
May 16, 2017

Daniel Sochor написал(а):

This solution works in Mathcad 14 but not prime. Is there a simple way to create a vector of the absolute values of another vector?

dsochor1-VisitorAuthor
1-Visitor
May 16, 2017

Thank you Valery, that was very simple