Previous Page | Next Page

Language Reference

NUM Function

NUM( matrix ) ;

The NUM function produces a numeric representation of elements in a character matrix. The NUM function takes as an argument a character matrix with elements that are character numerics and produces a numeric matrix with dimensions that are the same as the dimensions of the argument and with elements that are the numeric representations (double-precision floating-point) of the corresponding elements of the argument.

For example, following statements display the result of converting a character matrix to a numerical matrix:

c = {"1" "2" "3"};
reset print;       /* display values and type of matrices */
m = num(c);

Figure 23.197 Numeric Matrix
Test of NLPHQN subroutine: No Derivatives

m 1 row 3 cols (numeric)

1 2 3

You can also use the PUTN function in Base SAS software to apply a SAS format to each element of a numeric matrix. The resulting matrix is character.

See also the description of the CHAR function which converts numeric matrices into character matrices.

Previous Page | Next Page | Top of Page