1 Pages (4 items)
Vector & matrix element magnitudes - Absolute or magnitude of elements in a vector - Messages
#1 Posted: 12/18/2012 8:16:17 AM
Hi,
I have a vector of tension & compression values signified by positive or negative values.
I am trying to return the maximum absolute value, regardless of tension or compression. In other words, I need to knock all the minus's off every element in the vector, and then return the Max value in the vector.
Is there a function for this (I can't find one), or how do I implement it quite simply?
I have found and installed customfunctions.dll which gives me better Max / Min functions that work on vectors, but this will still not work for me in this case, as it doesn't account for +ve or -ve.
Anyone got a solution?
Thanks.
I have a vector of tension & compression values signified by positive or negative values.
I am trying to return the maximum absolute value, regardless of tension or compression. In other words, I need to knock all the minus's off every element in the vector, and then return the Max value in the vector.
Is there a function for this (I can't find one), or how do I implement it quite simply?
I have found and installed customfunctions.dll which gives me better Max / Min functions that work on vectors, but this will still not work for me in this case, as it doesn't account for +ve or -ve.
Anyone got a solution?
Thanks.
#2 Posted: 12/18/2012 8:48:03 AM
try 'absolute value' with the function 'mat2sys' included in customFunctions-plugin
Look at this post to see if it applies to your problem:
Apply a function over an array or vector
Look at this post to see if it applies to your problem:
Apply a function over an array or vector
#3 Posted: 12/18/2012 9:01:46 AM
Ah, that kind of worked.
Went with: Max(abs(mat2sys(V)))
I'm not familiar with 'systems', so unsure why that works and it doesn't with a matrix as defined. Is that an Smath thing? I don't recall MathCAD doing that.
Went with: Max(abs(mat2sys(V)))
I'm not familiar with 'systems', so unsure why that works and it doesn't with a matrix as defined. Is that an Smath thing? I don't recall MathCAD doing that.
#4 Posted: 12/18/2012 9:19:48 AM
WroteHi,
I have a vector of tension & compression values signified by positive or negative values.
I am trying to return the maximum absolute value, regardless of tension or compression. In other words, I need to knock all the minus's off every element in the vector, and then return the Max value in the vector.
Is there a function for this (I can't find one), or how do I implement it quite simply?
I have found and installed customfunctions.dll which gives me better Max / Min functions that work on vectors, but this will still not work for me in this case, as it doesn't account for +ve or -ve.
Anyone got a solution?
Thanks.
Hi FrugalTPH,
You can find the absolute maximum/minimum value also using the built-in functions (see the attachment).
regards,
w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Radovan Omorjan 12/18/2012 11:31:00 AM
1 Pages (4 items)
-
New Posts
-
No New Posts