imat_num2dir


Purpose

Convert direction number(s) to coordinate direction string(s).

Syntax

d=imat_num2dir(x)

Description

IMAT_NUM2DIR is a utility function that converts numeric direction codes to coordinate direction strings.

The numeric argument x can be either a scalar integer from -6 to 6 (in which case IMAT_NUM2DIR will return a string), or an nx1 array of such values (in which case IDEAS_NUM2DIR will return an nx4 array of type char).

The direction string returned by IMAT_NUM2DIR for each numeric code is given in the following table.

Numeric code Direction Numeric code Direction
1 X+ -1 X-
2 Y+ -2 Y-
3 Z+ -3 Z-
4 RX+ -4 RX-
5 RY+ -5 RY-
6 RZ+ -6 RZ-


Any other value returns a null string.

Examples

>> x=(-7:7)'
x =
    -7
    -6
    -5
    -4
    -3
    -2
    -1
     0
     1
     2
     3
     4
     5
     6
     7

>> imat_num2dir(x)
ans =

    RZ-
    RY-
    RX-
    Z-
    Y-
    X-

    X+
    Y+
    Z+
    RX+
    RY+
    RZ+

>>

See Also

imat_dir2num