Return to Statement


Unit Vector Example

   NUMBER/A(3),B(3)
B=UNITF(A)

is equivalent to the following expressions:

   C=VLENF(A)
B(1)=A(1)/C
B(2)=A(2)/C
B(3)=A(3)/C

The following statements show an example of the UNITF function.

Statement

Assigned Value

NUMBER/A(3),B(3)

 

DATA/A,1,4,8

A(1)=1,A(2)=4,A(3)=8

B=UNITF(A)

B(1)=.1111,B(2)=.4444,B(3)=.8889