cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

SOLVED
1-Newbie

## Mathcad Prime 3.0 "IF" "Else If" help

I am trying to set up a simple if-otherwise statement and I am running into some trouble.

1.) I am not sure if it even set up correctly

2.) I am getting an error reffering to scalar vs. matrix.

If Me< (or eqaul to) Myw use first equation. (0.92-.17*Me etc.)

If not, use the second one (1.92-1.17etc.)

Any help or input is greatly appreicatied.

Thank you,

jReck

1 ACCEPTED SOLUTION

Accepted Solutions
24-Ruby IV
(To:ptc-5373964)
 1.) I am not sure if it even set up correctly

No, you didn't.

 2.) I am getting an error reffering to scalar vs. matrix.

Because you tried to multiply the first expression with an if-construct.

See attached.

6 REPLIES 6
24-Ruby IV
(To:ptc-5373964)
 1.) I am not sure if it even set up correctly

No, you didn't.

 2.) I am getting an error reffering to scalar vs. matrix.

Because you tried to multiply the first expression with an if-construct.

See attached.

24-Ruby I
(To:Werner_E)

Better use not the operator but the function if.

We can use in this case the free Mathcad Express!

Happy New Year!

Thanks for the help guys!

1-Newbie
(To:Werner_E)

How would you set up an "IF" statement with two "IFs"? See attached.

The middle equation should be the controlling factor.

24-Ruby IV
(To:ptc-5373964)

I guess the second if should be under the first one, not inside and you should use "else if".

Looking at the examples of the built-in help would be a good idea.

See the first example here:

The local variable y in that example has no relationship to the function-name y (but I consider it bad habit to use the same name for two different things). In fact you could use that example without any temporary variable at all (but using it is considered better style and is less failure prone with larger programs).

If you are interested in using your sheet with the free Prime Express Edition, as Valery pointed out, you may also use nested if-functions.

24-Ruby I
(To:Werner_E)
 Werner Exinger wrote:If you are interested in using your sheet with the free Prime Express Edition, as Valery pointed out, you may also use nested if-functions.

You can find on my site Mathcad sheets for Prime (if operator) and for Express (if function) - http://twt.mpei.ac.ru/TTHB/2/OIVT/IVTANThermo/Eng/index.htm

And for Russian Mathcad - Smath.

And for Excel too.

Announcements
Check out the latest