TI-BASIC:Augment

From Learn @ Cemetech
Revision as of 18:21, 24 February 2016 by Maintenance script (talk | contribs) (Initial automated import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

AUGMENT.GIF

Command Summary

Combines two lists or matrices into one. In the case of matrices, this is done horizontally rather than vertically.

Command Syntax

augment(list1,list2

augment(matrix1,matrix2

Menu Location

Press:

  1. 2nd LIST to access the List menu
  2. RIGHT to access the OPS submenu
  3. 9 to select augment(, or use arrows

Alternatively, press:

  1. MATRX (on the TI-83) or 2nd MATRX (TI-83+ or higher) to access the Matrix menu
  2. RIGHT to access the MATH submenu
  3. 7 to select augment(, or use arrows

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The augment( command is used to combine two lists or two matrices into one. For lists, this is done the obvious way: adding the elements of the second on to the elements of the first. For example:

augment({1,2,3,4},{5,6,7
	{1 2 3 4 5 6 7}

For matrices, the columns of the second matrix are added after the columns of the first matrix: an R by C matrix augmented with an R by D matrix will result in an R by (C+D) matrix. For example:

augment([[1][2]],[[3][4]
	[[1 3]
	 [2 4]]

Advanced Uses

Use the ^^T^^ (transpose) command if you want to combine two matrices vertically, rather than horizontally. For example:


augment(1,2T,3,4T)T
	[[1 2]
	 [3 4]]


Optimization

You may be tempted to use augment( to add one element to the end of a list:


:augment(L1,{X→L1


However, the following way is faster and more memory-efficient while the program is running (although it increases the program's size):


:X→L1(1+dim(L1


Error Conditions

  • ERR:DATA TYPE is thrown if you try to augment a single number to a list, a common error -- use {X instead of X.
  • ERR:DIM MISMATCH is thrown if you try to augment two matrices with a different number of rows.
  • ERR:INVALID DIM is thrown if one of the arguments is a list with dimension 0, or if the result would have dimension over 999 (for lists) or 99x99 (for matrices).

Related Commands