Get Help

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Mathcad Prime 3.0 "IF" "Else If" help

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-31-2013
12:13 PM

12-31-2013
12:13 PM

See attached spreadsheet.

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

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-31-2013
12:50 PM

12-31-2013
12:50 PM

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-31-2013
12:50 PM

12-31-2013
12:50 PM

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
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-31-2013
02:08 PM

12-31-2013
02:08 PM

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
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-02-2014
09:27 AM

01-02-2014
09:27 AM

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

Thanks for the help guys!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-02-2014
09:50 AM

01-02-2014
09:50 AM

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
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-02-2014
01:15 PM

01-02-2014
01:15 PM

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
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-02-2014
04:45 PM

01-02-2014
04:45 PM

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.