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

SOLVED
Highlighted
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

Tags (5)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

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

 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
Highlighted

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

 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.

Highlighted

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

Better use not the operator but the function if.

We can use in this case the free Mathcad Express!

Happy New Year!

Highlighted

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

Thanks for the help guys!

Highlighted

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

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

The middle equation should be the controlling factor.

Highlighted

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

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.

Highlighted

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

 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