# Function Ranm; Function Sub - HP 50g User Manual

Graphing calculator.

If using RPN mode, we assume that the matrix is in the stack and use {6} `
RDM.
Note: Function RDM provides a more direct and efficient way to transform lists
to arrays and vice versa, than that provided at the end of Chapter 9.

## Function RANM

Function RANM (RANdom Matrix) will generate a matrix with random integer
elements given a list with the number of rows and columns (i.e., the dimensions
of the matrix). For example, in ALG mode, two different 2 3 matrices with
random elements are produced by using the same command, namely,
R NM({2,3}) :
In RPN mode, use {2,3} ` R NM.
Obviously, the results you will get in your calculator will most certainly be
different than those shown above. The random numbers generated are integer
numbers uniformly distributed in the range [-10,10], i.e., each one of those 21
numbers has the same probability of being selected. Function RANM is useful
for generating matrices of any size to illustrate matrix operations, or the
application of matrix functions.

### Function SUB

Function SUB extracts a sub-matrix from an existing matrix, provided you
indicate the initial and final position of the sub-matrix. For example, if we want
to extract elements a
matrix, in ALG mode, use:
, a
, a
, and a
12
13
22
from the last result, as a 2 2 sub-
23
Page 10-11  