Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
Calculates sum value in a matrix column.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Matrix | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
MatrixRef | The matrix reference number. | $matrix | |
Column | The index of the column. Default is 0. |
0 | |
firstRow | The index of first row. Default is 0. |
0 | Optional |
lastRow | The index of last row. Default is FM.SQL.RowCount-1. |
5 | Optional |
Returns number or error.
Sums the values in a matrix:
Set Variable [ $matrix; Value: MBS("Matrix.New";3;3) ]
# Set the values of the matrix
Set Variable [ $r; Value: MBS( "Matrix.SetColumn"; $matrix; 0;"15¶07¶92" ) ]
Set Variable [ $r; Value: MBS( "Matrix.SetColumn"; $matrix; 1;"17¶3¶60" ) ]
Set Variable [ $r; Value: MBS( "Matrix.SetColumn"; $matrix; 2;"15¶1¶87" ) ]
# Add all numbers in the matrix (3x3)
Set Variable [ $a; Value: MBS( "Matrix.Sum"; $matrix; 0 ) ]
Set Variable [ $b; Value: MBS( "Matrix.Sum"; $matrix; 1 ) ]
Set Variable [ $c; Value: MBS( "Matrix.Sum"; $matrix; 2 ) ]
Set Variable [ $sum; Value: $a+$b+$c ]
Set Variable [ $r; Value: MBS("Matrix.Release"; $matrix) ]
Created 8th April 2019, last changed 2nd November 2020
Feedback: Report problem or ask question.