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!

if...and...

Status
Not open for further replies.

Bossebo

Structural
May 12, 2010
5
Hi
I realy searched in mathcad help for this one but cant find it.

I would like mathcad to do this:

f(x)=a+b if a>0 and b>0

i know how to do it with just one condition but how do i get it to check both if a>0 and b>0 ??
 
Replies continue below

Recommended for you

Did you search for Boolean Operators?

TTFN

FAQ731-376
 
Sorry but my english is quite bad.

I know how to do this:

f= a+b if a>0
a-b otherwise

witch in words meens that matchad check wether a is bigger than 0 and the set f=a+b. if a should happen to be smaler than 0 it set f to a-b.

Now i want mathcad to check wether both a and b is bigger than 0 and then set f=a+b otherwice f should be a-b.

I thought something like this would work:
f=a+b if a>0,b>0
a-b otherwise

but it dident. I simply want to write an if...and..then... formula

Do I make myself clear?
 
This is not a question of English, but of math, and you already wrote the form of the equation in your original posting:

if((a>0)^(b>0),a+b,"not valid")

TTFN

FAQ731-376
 
Thanks everyone. I searched for boolean and found out how to do!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor