GVALARRAY

Purpose:

Creates an array of all the same real value.

Syntax:

GVALARRAY(val, numrows, numcols)

val

-

A real, the value for the array

numrows

-

An integer. The number of output rows.

numcols

-

Optional. An integer, the number of output columns. Defaults to 1.

Returns:

A series or array.

Example:

gvalarray(12.5, 3, 1)

 

returns the series {12.5, 12.5, 12.5}

Example:

gvalarray(12.5, 3, 3)

 

returns the 3x3 array:

 

{{12.5, 12.5, 12.5},

 {12.5, 12.5, 12.5}, 

 {12.5, 12.5, 12.5}} 

Example:

gvalarray(1.0, 3, 3) + i * gvalarray(2.0, 3, 3)

 

returns the 3x3 complex array:

 

{{1 + 2i, 1 + 2i, 1 + 2i},

 {1 + 2i, 1 + 2i, 1 + 2i}, 

 {1 + 2i, 1 + 2i, 1 + 2i}} 

Remarks:

GVALARRAY only excepts a real value.

See Also:

EYE

GLINE

ONES

RAVEL

SIZE

ZEROS