Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
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