Often times functions might return
Undefined in Mathematica, e.g. when the
Volume@RegionIntersection is called for 2 objects which have no overlapping volume. A simple
If statement checking if the return has been indeed
Undefined does not seem to work. For example,
a=Undefined; If[a == Undefined, Print["yes"]] ends up printing the command itself.
- How can we check if a variable (or a function return) such as
ahas been assigned as
Undefinedand assign a different value to it in that case?