Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
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.) 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.
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.
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!
How would you set up an "IF" statement with two "IFs"? See attached.
The middle equation should be the controlling factor.
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.
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.