REPEAT Function
creates a new matrix of repeated values
- REPEAT( matrix, nrow, ncol)
The inputs to the REPEAT function are as follows:
- matrix
- is a numeric matrix or literal.
- nrow
- gives the number of times matrix is repeated across rows.
- ncol
- gives the number of times matrix is repeated across columns.
The REPEAT function creates a new matrix by repeating the values
of the argument matrix nrow*ncol times, ncol
times across the rows, and nrow times down the columns.
The matrix argument can be numeric or character.
For example, the following statements result
in the matrix Y, repeating the X
matrix twice down and three times across:
x={ 1 2 ,
3 4} ;
y=repeat(x,2,3);
Y
1 2 1 2 1 2
3 4 3 4 3 4
1 2 1 2 1 2
3 4 3 4 3 4
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.