Use the subscript operator ([ ]) to pick out elements or submatrices from matrices. The Subscript() function is usually written as a bracket notation after the matrix to be subscripted, with arguments for rows and columns.
The expression A[i,j] extracts the element in row i, column j, returning a scalar number. The equivalent functional form is Subscript(A,i,j).
P = [1 2 3, 4 5 6, 7 8 9];
P[2, 3]; // returns 6
Subscript( P, 2, 3 ); // returns 6
A = [1 2, 3 4, 5 6];
test = A[3, 1];
Show( test );
test = 5;
P = [1 2 3, 4 5 6, 7 8 9];
P[[2 3],[1 3]]; // matrix subscripts
P[{2, 3},{1, 3}]; // list subscripts
[4 6,
7 9]
Q = [2 4 6, 8 10 12, 14 16 18];
Q[8]; // same as Q[3,2]
16
Q = [2 4 6, 8 10 12, 14 16 18];
Q[{5, 7, 9}];
Q[[5 7 9]];
ii = [5 7 9];
Q[ii];
ii = {5, 7, 9};
Q[ii];
Subscript( Q, ii );
P = [1 2 3, 4 5 6, 7 8 9];
For( i = 1, i <= 3, i++,
	For( j = 1, j <= 3, j++,
		Show( P[i, j] )
	)
);
A[k, 0] = [];  // deletes the kth row
A[0, k] = [];  // deletes the kth column
P = [1 2 3, 4 5 6, 7 8 9];
P[0, 2];
[2, 5, 8]
P[0, [3, 2]];
[3 2, 6 5, 9 8]
P[3, 0];
[7 8 9]
P[[2, 3], 0];
[4 5 6, 7 8 9]
P[0, 0];
[1 2 3, 4 5 6, 7 8 9]
P = [1 2 3, 4 5 6, 7 8 9];
P[2, 3] = 99;
Show( P );
P=[1 2 3, 4 5 99, 7 8 9]
P = [1 2 3, 4 5 6, 7 8 9];
P[[1 2], [2 3]] = [66 77, 88 99];
Show( P );
P=[1 66 77, 4 88 99, 7 8 9]
P = [1 2 3, 4 5 6, 7 8 9];
P[0, 2] = [11, 22, 33];
Show( P );
P=[1 11 3, 4 22 6, 7 33 9]
P = [1 2 3, 4 5 6, 7 8 9];
P[3, 0] = [100 102 104];
Show( P );
P=[1 2 3, 4 5 6, 100 102 104]
P = [1 2 3, 4 5 6, 7 8 9];
P[2, 0] = 99;
Show( P );
P=[1 2 3, 99 99 99, 7 8 9]
You can use operator assignments (such as +=) on matrices or subscripts of matrices. For example, the following statement adds 1 to the i - jth element of the matrix:
P = [1 2 3, 4 5 6, 7 8 9];
P[1, 1] += 1;
Show( P );
P=[2 2 3,
	4 5 6,
	7 8 9];
 
P[1, 1] += 1;
Show( P );
P=[3 2 3,
4 5 6,7 8 9];
If you are working with a range of subscripts, use the Index() function :: to create matrices of ranges.
T1 = 1 :: 3; // creates the vector [1 2 3]
T2 = 4 :: 6; // creates the vector [4 5 6]
T3 = 7 :: 9; // creates the vector [7 8 9]
T = T1 |/ T2 |/ T3; // concatenates the vectors into a single matrix
T[1 :: 3, 2 :: 3]; // refers to rows 1 through 3, columns 2 and 3
[2 3, 5 6, 8 9]
T[Index( 1, 3 ), Index( 2, 3 )]; // equivalent Index function
[2 3, 5 6, 8 9]