mag
Magnitude function.
Syntax
mag(expr )
Argument
- expr
 - A valid scalar or vector expression.
 
Example
| Templex Expression | Result | 
|---|---|
{mag(-2)} | 
                                2 | 
                            
{mag( {0, 3, 4} )} | 
                                5 | 
                            
Comments
The mag function returns a scalar which is the square root of the sum of the squares of each element in expr.
If expr is a scalar, the result is the absolute value of expr.
If expr is a vector, the result is the length or norm of the vector.