Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python 3.7 Question 2 (25 points) 78 Define a matrix 10.3 2 45 -36 8 1. Write a loop and using if commands replace all
Python 3.7
Question 2 (25 points) 78 Define a matrix 10.3 2 45 -36 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. -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 it commands in order to get full points, simply typing the new matrix -5 100 100 100 -5 100 100 100 5 will not result in any points Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started