0
$\begingroup$

trying to write this function, while b,d are known numbers and hj is the variable

enter image description here

thank you very much

$\endgroup$
1
  • 1
    $\begingroup$ Use Piecewise, i.e., Dj[hj_] := Piecewise[{{hj + b, hj <= 2 d - b}, {(hj + b)/2 + d, hj > 2 d - b}}] $\endgroup$
    – Bob Hanlon
    May 19 at 17:27
0
$\begingroup$

Try functionName[variable_]:=If[variable>something, what to do if true, what to do else].

$\endgroup$
0

Not the answer you're looking for? Browse other questions tagged or ask your own question.