Question: sing a nested for loop, create the following 1 2 times 1 5 matrix. A = 1 1 2 1 3 1 1 2

sing a nested for loop, create the following 12\times 15 matrix.
A =
11
2
1
31
121
15
22
2
2
32
122
15
33
2
3
33
123
15
..................
1212
2
12
312
1212
15
.
Note that aij = i/j.
a.) Assign the matrix above to the variable A1.
b.) Assign a copy of A1 to the variable A2. Modify the 4th row of A2 to be a row of
zeros.
c.) Use array slicing to assign the submatrix made up of rows 3,4, and 5 and the last
4 columns of A1 to the variable A3.
d.) Assign the row 2 of A1 to the variable A4. Make sure that A4 is a 2D array of
shape (1,15)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!