Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

picking up the minimum values

Status
Not open for further replies.

metallicmanuel

Structural
May 28, 2008
1
Hi
I have recently started to use Mathcad 14.

I would like to pick out the minimum value from a set and that value should not be a negative value, i need the least positive integer.
for example
say a set A= (-10 , 2, 4 ,5)
the answer I want is 2 and not -10 which is actually the minimum value.

I tried using the command min(....) but this picks up the least of all integers mentioned in the set
thanks
 
Replies continue below

Recommended for you

How about taking the minimum of the absolute values of the elements of your array?
 
UcfSE: in the case of the given example, applying absolute values would work, but if the absolute value of any negative value is lower than a positive value, the answer will be incorrect.

I have also attached an alternate solution that should work for both the given example and any other set of values. Good luck!
 
 http://files.engineering.com/getfile.aspx?folder=f507f04c-4527-45ef-ad3a-ec6d31f9f30a&file=solution.bmp
Status
Not open for further replies.

Part and Inventory Search

Sponsor