Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
How to solve the below mention condition
if D<= 15 = 5
if D>15<=36 = 6
if D>36<=60 = 8
if D<60 = 10
@ranto wrote:
How to solve the below mention condition
if D<= 15 = 5
if D>15<=36 = 6
if D>36<=60 = 8
if D<60 = 10
"solve" ??? This is not an equation which could be solved for a specific variable.
Obviously you would like to define a function or just calculate one specific value, correct?
And the last condition sure should read D>60, right?
You did not state which version of Mathcad or Prime you are using. In real Mathcad it would look like in the picture below.
If you use Prime it would work the same way, but will look a bit different ("else" instead of "otherwise").
If you are using the free Prime Express you can't use programming but you can still define your function using the if-function instead of the programming if-condition. This looks less clear and works similar to the "if" in a spreadsheet like Calc or Excel (see the function definition for f.2 below the plot in the picture).
In case you don't want to define a function but just want to calculate a single result, you would simply write <variablename>:=.... instead of f(D):=....
Thank you