Question: python 3.7 please help Question 2 (25 points) Define a matrix A = 1.2 2 45 3.4 8 -36 10.3 78 8 1. Write a

python 3.7 please help
python 3.7 please help Question 2 (25 points) Define a matrix A

Question 2 (25 points) Define a matrix A = 1.2 2 45 3.4 8 -36 10.3 78 8 1. Write a loop and using if commands replace all the numbers in the main diagonal (top left to bottom right diagonal) with -5. You need to write a loop to replace the numbers in the main diagonal. You need to demonstrate how to loop over an array and how to use if statements! I will NOT give you points if you simply type the solution or use a built in command such as diag() etc. A= 7 -5 2 45 3.4 5 -36 10.3 78 -5 2. Next, use this newly created matrix and write a loop and replace numbers in the off-diagonal with 100. Again, use a loop and if commands in order to get full points, simply typing the new matrix A = 1-5 100 100 100 -5 100 100 100 will not result in any points

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!