×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

if...and...

if...and...

if...and...

(OP)
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    ??

RE: if...and...

(OP)
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?

RE: if...and...

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: Eng-Tips.com Forum Policies

RE: if...and...

f:=if((a>0)*(b>0),a+b,a-b)

RE: if...and...

(OP)
Thanks everyone. I searched for boolean and found out how to do!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources