CMatrix:Set


The Set method adds or changes the value of the member at a specified CMatrix index.

Syntax

CMatrix:Set( n, m, value )

bullet.gif    n is the row index to set, beginning at 1.

bullet.gif    m is the column index to set, beginning at 1.

bullet.gif    value is the target value to set.

Example

The following script sets 2 of the CMatrix members. The values of 2 members are them printed, showing an invalid index returning the value 0:

M = new_matrix()

-- create a CMatrix

M:Set( 4, 2, 50.5)

-- set the member at index [4][2]

M:Set( 1, 5, 22.5)

-- set the member at index [1][5]

Printf("A[4][2]= %lg",M:Get(4,2))

-- result: M[4][2] = 50.5

Printf("A[1][2]= %lg",M:Get(1,2))

-- result: M[1][2] = 0 (doesn't exist)s

Related Topics

CMatrix class, Init


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.