Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
I'm following the attached example design, but I can't tell what function/tool in Mathcad they're using. I understand the purpose of the section and what values it should return, I'm just not sure how to make Mathcad do it. It kind of looks like a programming block, but it doesn't have the bar on the right and it isn't formatted the same inside. What's tripping me up is that the value if "x" isn't constant, it's variable so I can't use simple if/else programming. I only have the file in PDF format.
Solved! Go to Solution.
@mappleby811 wrote:
I'm following the attached example design, but I can't tell what function/tool in Mathcad they're using. I understand the purpose of the section and what values it should return, I'm just not sure how to make Mathcad do it. It kind of looks like a programming block, but it doesn't have the bar on the right and it isn't formatted the same inside.
Yes, you are right - its a programming block. but its made with real Mathcad, a version prior to Prime (maybe Mathcad 15 or older). Thats the reason a programming block looks differently.
There is only a single vertical line indicating a programing block, if there is only one command in an "if", the if-statement is condensed to just one line instead of spreading over two and instead of "else" the older Mathcad versions used "otherwise".
In Prime it would look like this:
And because the else branch is the last statement in the program, you can omit the "else" and also the last "return":#
And using "elseif" you could do it without any explicit "return" statement
You could even use nested if-functions instead of the programming if-statement similar to what you would do in a spreadsheet like Calc or Excel
It takes up much less space but sure is harder to read.
What's tripping me up is that the value if "x" isn't constant, it's variable so I can't use simple if/else programming. I only have the file in PDF format.
??? Not sure what you mean?
It is a function that returns one of three values depending on whether x is less than x2, greater than x1 (obviously x1>x2) or between x2 and x1.
Only if x2 < x < x1 a value dependent on x is returned, otherwise constant values phi.a resp. phi.b
Prime 9 sheet attached
@mappleby811 wrote:
I'm following the attached example design, but I can't tell what function/tool in Mathcad they're using. I understand the purpose of the section and what values it should return, I'm just not sure how to make Mathcad do it. It kind of looks like a programming block, but it doesn't have the bar on the right and it isn't formatted the same inside.
Yes, you are right - its a programming block. but its made with real Mathcad, a version prior to Prime (maybe Mathcad 15 or older). Thats the reason a programming block looks differently.
There is only a single vertical line indicating a programing block, if there is only one command in an "if", the if-statement is condensed to just one line instead of spreading over two and instead of "else" the older Mathcad versions used "otherwise".
In Prime it would look like this:
And because the else branch is the last statement in the program, you can omit the "else" and also the last "return":#
And using "elseif" you could do it without any explicit "return" statement
You could even use nested if-functions instead of the programming if-statement similar to what you would do in a spreadsheet like Calc or Excel
It takes up much less space but sure is harder to read.
What's tripping me up is that the value if "x" isn't constant, it's variable so I can't use simple if/else programming. I only have the file in PDF format.
??? Not sure what you mean?
It is a function that returns one of three values depending on whether x is less than x2, greater than x1 (obviously x1>x2) or between x2 and x1.
Only if x2 < x < x1 a value dependent on x is returned, otherwise constant values phi.a resp. phi.b
Prime 9 sheet attached
You are... The MAN (or WOMAN)!
Thank you so much! This question is had me stumped for a while now and it just occurred to me to post here.