Skip to content

The randMat() Command

Command Summary Command Syntax Calculator Compatibility Token Size
Generates a random matrix. randMat(rows,columns This command works on all calculators. 1 byte
  • Press 2nd MATH to enter the MATH popup menu.
  • Press 7 to enter the Probability submenu.
  • Press 7 to select randMat(.

The randMat() Command

The randMat() command generates a random matrix: randMat(rows,columns) generates a rows by columns matrix whose entries are random integers between -9 and 9.

:RandSeed 0
:randM(3,2)
           [4  -2]
           [0  -7]
           [8  8 ]

Advanced Uses

Using the 68k:RandSeed command makes the random matrix entirely predictable: after setting the random seed to some value, the same random matrix will be returned every time (assuming the size is the same). See the RandSeed page for details of how random numbers are generated.

Error Conditions

260 - Domain error happens when the rows and columns parameters aren't positive integers..

Authors: KG