CMatrix:Set

CMatrix:Volume


The Volume method returns the sum of all matrix values.

Syntax

vol = CMatrix:Volume()

Remarks

This method computes the sum of all CMatrix elements. If the matrix elements were to define a grid of height values, the sum of all members would be the volume under the matrix profile.

Example

The following script fragment computes the volume of the CMatrix:

 

M = CMatrix:new()

-- create a CMatrix

M:Init( 5, 7, 1)

-- setup a 5 x 7 matrix

Printf("Vol = %lg", M:Volume())

-- result: Vol = 35

Related Topics

CMatrix , Init, Normalize