matrix
A matrix is a two dimensional array which consist of rows and columns of float values. When defining a matrix the
user must always define the number of columns or rows the matrix holds.
matrix $myMatrix[3][5];
The dimension of this matrix would be 3 rows 5 column. The first square brackets are the rows the second brackets are columns.
If we were to plug in values this is how it would look:
matrix $m[3][5]= <<1,3,5,7,9; 2,4,6,8,1; 4,7,0,3,6>>;
print $m;
// Gives you a result of:
<< 1, 3, 5, 7, 9;
2, 4, 6, 8, 1;
4, 7, 0, 3, 6>>
If I wanted to grab an individual component of the array I would call it as such
matrix $m[3][5]= <<1,3,5,7,9; 2,4,6,8,1; 4,7,0,3,6>>;
print $m[0][3];
// Gives you a result of:
7
//we are given a 7 because array start counting at 0