In the class ArrayIndexing below you should first define a 2x3-array and set values to every position in the array. Also define a second array while you're at it, with the same size but with different values. The last thing you should do is to change a few values in each array. Then you're done!
Oh, one more thing, what are the results after changing the values?
When you set the values in the arrays you can use the fill function to fill a whole array with a value. fill(value, nrOfRows, nrOfColumns).
the result of array2 {{10, 1, 1}, {23, 1, 1}}
the result of array2 {{1, 1, 1}, {100, 100, 100}}
In the class ArrayIndexing2 below you should first define a 2x2-array and set values to every position in the array. Then define a second 2x4-array with different values. This time you should change a whole row in each array.
What are the results after changing the values?
the result of array1 is {{9, 9}, {2, 20}}
the result of array2 {{7, 7, 7, 7}, {6, 7, 8, 9}}
What is the result of the vectors v1, v2, v3, v4, v5, v6, v7, v8 and v9 below?
v1 gets the value {22, 33, 44}.
v2 gets the third row of V, i.e. the vector {44, 11, 77}.
v3 gets the second element (in brackets) in the third row in V, i.e. {11}.
v4 gets the second row of W, i.e. {13, 88, 43}
v5 gets the first and second elements of Y, i.e. {23, 24}
v6 gets the first and second elements on the third row of W, i.e. {99, 43}
v7 gets the first and second elements of the third row of V, i.e. {44, 11, 77}
v8 gets the 3:rd through 4:th elements of Y as {25, 26}
v9 gets the 1:st to 5:th elements step 2 elements as {23, 25, 27}