basic.mat Statement/BASIC Program

basic.mat

Command basic.mat Statement/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
Description assigns data to each element of a dimensioned array variable to a specific value in one operation.

Array variables must be defined in a "dim", "common", or "file" statement.

{mat} array.variable1 = {mat} array.variable2

Copies one array into another. The number of elements in "array.variable1" must be less than or equal to the number of elements in "array.variable2". It is possible to assign a two-dimensional array to a single-dimensional array, and vice-versa.
Syntax mat array.variable = expression
{mat} array.variable1 = {mat} array.variable2
Options
Example
mat customer.item = "" 

This sets every array element of "customer.item" to null.

mat customer.item.history = mat customer.item

This sets every array entry of "customer.item.history" to its 
corresponding entry in "customer.item".

dim a(10,2)
dim b(20)
mat b = 1
b(3) = 2
mat a = mat b

This example assigns all of the element in the two dimensional array, 
"a" into the one dimensional array, "b". The rows are 
"filled" before the columns, therefore a(2,1) = 2.
Purpose
Related basic.assignment
basic.statements
basic.dim
basic.matread
basic.matwrite