Skip to main content
1-Visitor
September 22, 2010
Solved

And function in programming

  • September 22, 2010
  • 4 replies
  • 3840 views

I have been trying to make that can determin wich variable that has the greatest value.

I found a simple way of doing it with the if command if I only have 2 or 3 variables. but if i get to 4 or more it gets a bit more complicated.

I have thought of using the "While" command but when ever i use it Mathcad freezes. So i guss it isn n option for me.

so is there a comman that could achive the following

e= a if (a greater b) and (a greater c) and (a greater d)

or b if (b greater a) and (b greater c) and (b greater d)

or c if (c greater a) and (c greater b) and (c greater d)

or d if (d greater a) and (d greater c) and (d greater d)

or somthing to the same effect.

regards

Anton

Best answer by MikeArmstrong

A few examples in the attached sheet.

Mike

4 replies

1-Visitor
September 22, 2010

The "match(,,) will locate the duplicates as well.

MCADunk_7.gif

jmG

1-Visitor
September 22, 2010

Do easier without programming:

without_programming.bmp

Viktor

1-Visitor
September 22, 2010

A few examples in the attached sheet.

Mike

1-Visitor
September 22, 2010

Thank you for the swift help.

I was so occupied with getting the programming to work that i didnt even consider other options.

Regards

Anton