TI-BASIC:Fill
Command Summary
Fills a list or matrix with one number.
Command Syntax
Fill(value,matrix)
Menu Location
Press:
- 2nd LIST to access the list menu.
- RIGHT to access the OPS submenu.
- 4 to select Fill(, or use arrows.
Alternatively, press:
- MATRX (83) or 2nd MATRX (83+ or higher) to access the matrix menu.
- RIGHT to access the MATH submenu.
- 4 to select Fill(, or use arrows.
TI-83/84/+/SE
1 byte
The Fill( command takes an existing list or matrix variable and sets all its elements to a single number. It doesn't return anything and only works on already defined variables.
{5}→dim(L1) Fill(2,L1) L1 {2 2 2 2 2} {3,4}→dim([A]) Fill(1,[A]) [A] [[1 1 1 1] [1 1 1 1] [1 1 1 1]]
Optimization
When creating a new list or matrix you want to fill with zeroes, it's better to delete it then create it with Dim(, which will set all entries to 0, than to set its dimensions with dim( (which may not clear what was there before) then use Fill(.
Errors
On a TI-84+CSE, using Fill(List,List) will cause a RAM clear. For example: Fill({1,2,3},{1,2,3} will cause a RAM Clear. this does not apply on any other models, only giving you argument and data type errors.